Your problem looks similar to another recent post which had base 10 integers of 60 thousand digits. For that particular problem there was no reason to convert the string to an integer. Please describe, at a higher level, the problem you're trying to solve so we can consider other approaches.

Your problem looks similar to another recent post which had base 10 integers of 60 thousand digits. For that particular problem there was no reason to convert the string to an integer. Please describe, at a higher level, the problem you're trying to solve so we can consider other approaches.

For this problem there is a reason to convert it to an integer, as I need to count how many prime factors below 100,000 it contains.

As an example, an integer consisting of 10^1 (10) 1's, have the following prime factors: (11, 41, 271 & 9091).

j (executable Iverson notation) converts a random string of 1e5 digits to an integer in a flash---well under a second. I asked for the prime factors which sent my computer into a page file hell which j was clever enough to abort. I expect that had I merely asked j to check for a 0 remainder on divisions by the primes less than 100000 there'd have been no trouble. OK, there's a problem with old python (or with your code).

Upgrade to a new python 2.7 or to python3.
The conversion takes place in a blink.

Here's a solution in j. j is now open source but wasn't. I think we haven't yet replaced custom arbitrary precision integer code with gmp. gmp is faster. (libgmp is also a huge library. That, and perhaps license problems have prevented python from incorporating it.) The run time for all the divisions gets fairly long. And the space used to solve the problem "all at once" is too big. I've got 4Gb RAM on an INTEL new-nomenclature-2 processor running between 2 and 3 GHz Lenovo T500 laptop computer.