Dynamically patch a Python function’s source code at runtime