Supplying pow() with 3 arguments pow(a, b, c) evaluates the modular exponentiation ab mod c:
pow(3, 4, 17) # 13
# equivalent unoptimized expression:
3 ** 4 % 17 # 13
# steps:
3 ** 4 # 81
81 % 17 # 13
For built-in types using modular exponentiation is only possible...