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