It's to be consistent whether or not optimisations have been enabled, this fix came about from the thread https://github.com/kripken/emscripten/issues/2265 where I explained that using the tempRet0 global sometimes worked and sometimes didn't - basically in asm.js the double declare thing means that just using tempRet0 gave me undefined.

So for asm.js we have to use an accessor method and as far as I can see it doesn't feel very friendly to have two different APIs (use the global or use an accessor) depending on the optimisation level.

The code in runtime.js declares the accessor for the non-optimised case and the code in emscripten.py overrides it for the asm.js case.

TBH because this is specifically retrieving something "slightly unusual" too I actually think that using an accessor from Runtime feels nicer and a bit "more specific" than using some global, actually I don't even like the name getTempRet0 I'd prefer something that related to what it's actually doing more - but I couldn't think of a good name. get64BitReturnMSB is probably more descriptive, but that's the best I can think of at the moment.