mpz_init(modulus)
mpz_init(exponent)
mpz_init(base)
mpz_init(result)
mpz_init(one)
mpz_init(r)
mpz_set_ui(result, 1)
mpz_set_ui(one, 1)
mpz_set(base, b)
mpz_set(exponent, e)
mpz_set(modulus, n)
Calculating very large exponents in python