In Maxima, one could do this:
showtime:all$
modulus:101$
rat(3)^10000000; /* rational arithmetic package uses modular arith */
Evaluation took 0.000 seconds... returns result 1.
to get a timing, run it in a loop...
for i:1 thru 1000 do rat(3)^10000000 ;
Evaluation took 0.0000 seconds (0.0040 elapsed) using 698.297 KB.
now subtract off the empty loop..
(%i6) for i:1 thru 1000 do nil;
Evaluation took 0.0000 seconds (0.0020 elapsed) using 380.984 KB.
(%o6) done
So it is appears to be about 0.0020 milliseconds using 317 bytes.
(Times on 2.6GHz Intel I5)
Maxima is written mostly in Common Lisp and is primarily aimed at
symbolic math, but also supports some numerical stuff.