I was trying to investigate why a trivial script method call was taking five times as long to execute as the equivalent trivial global function. It became obvious when I checked out the bytecode: every method starts with an AddRef() on the this pointer, and ends with a Release(). These are 'somewhat' expensive function calls handling atomics and such, and completely unnecessary in a large amount of cases.
It really feels like the caller should be responsible for keeping alive the object it's calling on, not the object itself. That way, the caller can make optimizations that would otherwise not be possible. Especially in our engine where many thousands of small methods are being called on script objects already held by the application code every frame, reducing the overhead of a method call seems like a useful thing to do.
After realizing that this behaviour was already in place for methods returning references, we tried to turn that behaviour on for all script method calls. The attached file is not so much a patch as this suggested change in behaviour. It's faster, better optimizable and more consistent - returning a reference no longer changes how the calling convention works. We've been using it for a little while.
It does mean the application needs to ensure objects it's calling methods on stay alive during those calls, which is added responsibility for application writers and a possible break in backwards compatibility, so not making this change is understandable as well. Maybe as an engine option?