PatchExitCallback
Game-side exit-patch callback. A Kotlin lambda written in an execute_code snippet becomes one of these via SAM conversion: Patches.onExit("...", "...") { key, self, args, returned, thrown -> ... }. Runs on whatever thread the patched method runs on — cheap and non-blocking is the contract.
Fires on BOTH exit paths: a normal return (thrown == null) and an exception leaving the method (thrown != null).
See also
for the entry phase