I haven’t looked into the details of the actual code, but I would expect the compiler optimizations and JIT to figure it all out and end up with very similar native code. Especially since both languages are mature and had enough time to reach such goals. But it’s quite possible my assumptions are incorrect.
Maybe when IPv6 is widely available, we’ll stop seeing this… For now, it sucks, but IPv4 blocks are expensive. Price or external IPv4, something’s gotta give.