When I put in Python interpreter a ** b % c with large a (20 figures) b (4 figures) c (20 figures) I saw that Python calculates it pretty fast, almost like pow (a,b,c). I expect
20 figures is laughably small on a modern computer. Try 2000 figures and you might see a difference.
Also, this past question is related: How did Python implement the built-in function pow()?