Call `self.class` only once in `init_internals`
Call `self.class` only once in `init_internals`

Calling `self.class` multiple times is not cheap.

```ruby
class A
  def self.foo
  end

  def foo1
    self.class.foo
    self.class.foo
    self.class.foo
    self.class.foo
  end

  def foo2
    klass = self.class
    klass.foo
    klass.foo
    klass.foo
    klass.foo
  end
end

a = A.new

Benchmark.ips do |x|
  x.report("foo1") { a.foo1 }
  x.report("foo2") { a.foo2 }
end
```

```
Warming up --------------------------------------
                foo1   341.701k i/100ms
                foo2   414.000k i/100ms
Calculating -------------------------------------
                foo1      3.194M (± 5.4%) i/s -     16.060M in   5.044653s
                foo2      4.276M (± 3.8%) i/s -     21.528M in   5.041999s
```

Similar with #36052.

yahonda/rails,kddeisz/rails,EmmaB/rails-1,Edouard-chin/rails,Edouard-chin/rails,Stellenticket/rails,Envek/rails,joonyou/rails,yawboakye/rails,betesh/rails,bogdanvlviv/rails,yahonda/rails,Vasfed/rails,Stellenticket/rails,Edouard-chin/rails,georgeclaghorn/rails,yahonda/rails,joonyou/rails,yawboakye/rails,lcreid/rails,MSP-Greg/rails,lcreid/rails,BlakeWilliams/rails,lcreid/rails,joonyou/rails,Edouard-chin/rails,Envek/rails,EmmaB/rails-1,Stellenticket/rails,kmcphillips/rails,rails/rails,BlakeWilliams/rails,esparta/rails,kddeisz/rails,Erol/rails,betesh/rails,esparta/rails,joonyou/rails,lcreid/rails,rails/rails,bogdanvlviv/rails,kmcphillips/rails,kddeisz/rails,MSP-Greg/rails,kmcphillips/rails,Erol/rails,EmmaB/rails-1,BlakeWilliams/rails,BlakeWilliams/rails,betesh/rails,kddeisz/rails,Erol/rails,MSP-Greg/rails,esparta/rails,georgeclaghorn/rails,georgeclaghorn/rails,yawboakye/rails,rails/rails,betesh/rails,Envek/rails,esparta/rails,MSP-Greg/rails,yawboakye/rails,bogdanvlviv/rails,Envek/rails,bogdanvlviv/rails,Stellenticket/rails,Erol/rails,yahonda/rails,Vasfed/rails,Vasfed/rails,georgeclaghorn/rails,Vasfed/rails,kmcphillips/rails,rails/rails