A JS integer is actually an instance of the "Number" object, you can to a small degree alter fundamental behavior even with primitive types
No it is not. It is a primitive, this difference is well defined in the ECMAScript spec. Same for strings. An instanceof String is strictly not the same as a string primitive (and there are runtime consequences).
You need to enclose numbers to access the prototype: 1.toString is undefined, whereas (1).toString() is "1"
If you want to find out more about the limits of what can be done to optimize Ruby, check out the Truffle project. That came out of someone's PhD dissertation on novel methods for doing JIT optimization for Ruby. It is sufficiently difficult and novel to warrant awarding a PhD for. Last time I heard, Truffle still could not run Rails.