There's a lot of overhead involved with calling a Python function --
have a look at the start (and end!) of the function eval_code() in
ceval.c. A Python stack frame is really quite a complicated beast,
even when local variables aren't stored in a dictionary. It involves
several C stack frames (call_object() -> call_function() ->
eval_code()) several new Python objects allocated on the heap (the
frame object, the argument list, the list containing local variables,
and the dictionary that might contain the local variables in some case
but which is always created; maybe more...)
--Guido van Rossum, CWI, Amsterdam <Guido.van.Rossum@cwi.nl>
URL: <http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>