Computes base-x raised to exponent-y, with an optional modular reduction z.
Parameters
x: bigint
The base bigint value.
y: bigint
The exponent bigint value (must be non-negative if modulus is specified).
Optionalz: bigint
Optional modulus bigint value.
Returns bigint
If z is not defined: x ** y. If z is defined: (x ** y) % z.
Remarks
Uses an efficient binary exponentiation algorithm (square-and-multiply) to handle
extremely large values of x, y, and z securely without precision loss.
Computes base-
xraised to exponent-y, with an optional modular reductionz.