It runs at 1/10 speed because it's interpreted bytecode, and it allocates a new PyInt object for each number in the loop.
You can get it back close to native speed by adding a type annotation and compiling the python file with Cython: http://docs.cython.org/src/userguide/language_basics.html#in...
def f(NUMBER):
cdef int i
for i in range(NUMBER):
pass