In [1]:
%timeit a = 2**10**6


10 loops, best of 3: 27.1 ms per loop

In [2]:
%timeit pow(2, 10**6, 10)


1000000 loops, best of 3: 850 ns per loop