>Where does the magic value of 127 come from? Shouldn't it be some constant or has MRI also hardcoded this to 127?
It's hardcoded in a couple of places, but you're right: it'd be better off in a constant.

>Just wondering whether this should always set the error status, perhaps of the subprocess being spawned if it fails?
Uh, what do you mean?