A bit of background, I'm 25 now and it looks like by the time I enter my phd program, i'll be 27. Is this too old to be starting a PHD in mathematics?
Lol. When I saw this thread, I was thinking it was going to be a 60 year old. 27 is fine. I've seen a lot of people who go work for a couple years and then go to grad school. Actually, I'm inclined to think that it's probably a better idea to start later, not really in terms of age, but in terms of background knowledge. Taking an extra year to study seems like a good idea to me.
I have a genuine passion for the subject so my interest level or motivation is not an issue here.
I thought that wasn't an issue for me, but it turned out it was. The problem is that I need complete intellectual freedom to be happy doing math. And when I say, complete, I mean complete. Like, if I want to learn about number theory one day, I should just be able to pick up a book and start learning it, just on a whim. As it is, I can't afford to do that. Why? Too much pressure to get certain things done, like publish papers or write a thesis, as well as teaching and pleasing the students. This just ruins the whole thing for me. Of course, even if somebody gave me a salary and told me to do whatever I wanted, I still would probably have to hold myself back a little bit from exploring everything I get curious about, just so I could get stuff done, but not even in the same ballpark as what I am having to do now to finish my PhD.
"It is in fact nothing short of a miracle that the modern methods of instruction have not yet entirely strangled the holy curiosity of inquiry; for what this delicate little plant needs more than anything, besides stimulation, is freedom. It is a very grave mistake to think that the enjoyment of seeing and searching can be promoted by means of coercion and a sense of duty."
--Albert Einstein
Logistically and financially, would I be better served trying to find a job in industry?
I don't know what your situation is. Financially, of course, no one gets a math PhD for the money, but if you only have to support yourself and don't care about buying shiny things, then it's fine, assuming you can get full funding.
In terms of the effect of age on ability, the only effect that I have seen as a 31 year old is due to graduate school making me feel stupid and robbing me of my confidence.