PhD after industry. Is it reasonable? I am a 31 years old software engineer at a big technology company in Silicon Valley. I have a master's degree in computer science and moved into working full time right at the time of my graduation. During those ~6 years in industry, I always tried to work a few hours during the day on my personal passion which is studying mathematics. Ultimately, every time I want to study a specific topic, I made so little progress because of my full-time job that I got frustrated. I figured just a few weeks ago that something needed to change and I should pursue my passion, which is research, and then got into my head that I must do a PhD. Now, the principal reason of doing a PhD for me is to be able to work full-time on maths. Something I am dreaming about, just thinking about it makes me very happy. On the other hand, at the same time, I know that I am taking a major pay cut (from 6 to 5 figures), and my lifestyle will dramatically change. 

EDIT :
Question has been put on hold so I will try to narrow down my questioning to a specific concern.

Considering that I have no demonstrable research experience, no real recommendations by academia people ( 7 years out of college, my teachers will likely had forgot about me ), no good grades in my masters ( average ), and a degree in computer science vs a math one, is it really possible to get accepted in a pure math phD program ?

Note : the only math experience I had is high school ( grade 18/20 ) and my personal experience ( which is not demonstrable )
I did my PhD in my fifties, after a computer science industry career. I am also a permanent resident alien. I can see two problems you are going to have that I avoided:


I didn't start my PhD until after I had my retirement fund saved up, so my standard of living did not change.
I continued in computer science, so my industry experience helped. I could read current computer science papers without too much difficulty.


One approach to the standard of living issue is to rehearse by trying to live for a year at a graduate student spending rate. That will let you find out if you can do it, and build up your investments with the money you are not spending.

The biggest problem I see is the transition to Mathematics. You could perhaps use the Mathematics GRE subject test to evaluate where you are relative to what you will be expected to know. You might do better doing a computer science PhD but specializing in theory. There are some fine open problems, including the great P=NP question.