Sorry but as you were correcting someone else's post (which is good) I thought that it was important to be accurate in yours.
You are right about the fact that 0**0 is controversial.
You could check for overflows condition in your loop:
if (a > (max_double / a))
But I agree that it's quite inneficient.
There might be some clever mathematical shortcut to check the above.
No, I'm no expert at math algorithm implementation. 😁
RE: C++ program of (a) power (b) without using builtin function