I've recently discovered the inspect and thought if it's possible to manually remove "outer" frames of the current frame and thus implementing tail-recursion optimization.    
Is it possible? How?
It's not possible. inspect doesn't let you rewrite the stack that way, and in any case, it only gives Python stack frames. Even if you could change how the Python stack frames hook up to each other, the C call stack would be unaffected.
Hacking tail-optimization