> The specific function which has the bug didn't need network access.
My reading of the bug and exploit is that the specific function not only needed network access, it was a intentional feature.
> It just needed to look something up in the environment.
That's not how I understand it - it parses the user-supplied input, and fetches (and subsequently executes) the package in the user-supplied input. The environment is irrelevant.
Now, bearing in mind that this was intentionally put in, and that the feature is working as intended and expected, how would a different programming language help?
Even if written in (for example) Haskell, the behaviour will be coded the same way, because that is the intended behaviour.