While tutoring a student recently, I have come across the situation of explain logarithms by first introducing functions of the form $$f(x)= a^x$$ where $a \ge 0,x\in \mathbb{R}$. My student then asked me a seemingly innocent question, what if $a < 0.$ I explained to her, that it suffices to consider the basic case $$g(x)= (-1)^x$$ however I told her that the answer to that is beyond the scope of the material. I did tell her the answer though, namely that $$g(x) = (-1)^x = (e^{i \pi})^x = e^{i x \pi}$$ which is the unit circle in the complex plane. Of course this opens up a new can of worms.
This got me to thinking, in the course of history the most probable chronological sequence was that functions of the form of $f(x)$ were considered before complex numbers were formalized. Then did mathematicians of the past simply state that functions with $a<0$ were simply undefined? Or was it the case that complex numbers were considered first?