It's a shame that all this works flawlessly in Python, but the runtime makes everything prohibitively slow.
ya python makes dealing with huge integers so simple it almost feels like you're cheating. would that every programming language could be like python in that way. "just use pyhthon"

Actually I think that Cpython is just using GMP internally to power it's "long" integer type. So that means it's doable.
GMP in its raw form is very powerful but also cumbersome to use, if only I make a wrapper around it like I did for libevent, then that would make this problem much simpler.