Compute (base ^ exponent) mod modulus efficiently for arbitrary-precision integers. The modulus must be positive.