Both this and `base` can be mutable via `mut base: T` and `mut exp: uint` in the function definition.

Also, personally, I'd rather see `if exp % 2 == 1` and `exp /= 2` and just let the optimiser handle lowering it to optimised form.