Assuming your "times" is associative, here's another more 'efficient' variation:
Clear[power];
power[b_, 1] := b;
power[b_, 0] := 1
power[b_, n_Integer] :=
With[{h = power[b, Quotient[n, 2]]}, b~times~h~times~h] /; Mod[n, 2] == 1;
power[b_, n_Integer] :=
With[{h = power[b, Quotient[n, 2]]}, h~times~h] /; Mod[n, 2] == 0;
This recursively splits the product into squares of half the power. In action:
power[x, 6]
times[times[times[x, x], x], times[times[x, x], x]]
Why might this be better? Consider:
times[a_, b_] := (count++; a b);
count = 0; {power[x, 250], count}
count = 0; {Nest[times[x, #] &, 1, 250], count}
{x^250, 12}
{x^250, 250}
times
is only evaluated 12 times in this scheme compared to 250 times in the simple approach. For the same effort we could do:
count = 0; {power[x, 2^250], count}
{x^1809251394333065553493296640760748560207343510400633813116524750123\
642650624, 250}
With[{n = 5}, (Composition @@ ConstantArray[times[x, #] &, n])[x]]
. $\endgroup$