Correctly implement needs_ref/needs_val for embed_py_func_global.
Correctly implement pass by reference to embedded python methods.

Note the skew of arg indicies due to implicit $this is PHP.