Say, I have a code which calls some function millions time from loop and I want the code to be fast:
def outer_function(file):
for line in file:
inne
Calling a function to invoke the pass
statement obviously carries a fairly high (∞) overhead. Whether your real program suffers undue overhead depends on the size of the inner function. If it really is just setting a pixel, then I'd suggest a different approach that uses drawing primitives coded in a native language like C or C++.
There are (somewhat experimental) JIT compilers for Python that will optimise function calls, but mainstream Python won't do this.