[ruby-core:119101] [Ruby master Bug#20716] Different instance_method behavior in Ruby 2.7 and Ruby 3.x