I have also filed a ticket with ruby/open3 repo here: ruby/open3#9, but this seems more like a Windows-specific issue as it works on Linux/Mac.
The following script will cause IRB console to become unresponsive on Ruby 3.1 on Windows installed by the Windows Ruby Installer x64-mingw-ucrt. This is using the version of Open3 packaged with Ruby (0.1.1)
$> irb
require 'open3'
Open3.capture2('ver')
# after this, the IRB console becomes unresponsive