If you put the digit values in a string then the base you can use gets very high very easily.
radixdigits = '0123456789ABCDEFGHI...'
And then you can do divmod() with the length of the string in order to get the current digit, and index the string with that number.