Pow1[a_,b_]:=Module[{res=1},
Do[res*=a,{b}];
res
]
Pow1[a_,b_]:=1/Pow1[a,-b]/;b<0

Table[{i,Pow1[10,i]//Timing//First},{i,1,100000,5000}]//ListPlot

Pow2[a_,b_]:=Module[{res=1,t=a, b1},
For[b1=b,b1≠0,b1=Floor[b1/2],
res*=If[Mod[b1,2]==1,t,1];
t*=t
];
res
]

Table[{i,Pow2[10,i]//Timing//First},{i,1,10000000,500000}]//ListPlot

Pow3[a_,b_]:=Module[{res=1,t=a, b1},
For[b1=b,b1≠0,b1=BitShiftRight[b1,1],
res*=If[BitAnd[b1,1]==1,t,1];
t*=t
];
res
]

Table[{i,Pow3[10,i]//Timing//First},{i,1,10000000,500000}]//ListPlot

Pow2[10,10000000]//Timing//First

Pow3[10,10000000]//Timing//First