For most of us who followed that path, if you have to ask the question then it may not be right for you and you should explore all your options before you jump.
There is a saying that "You don't choose mathematics. Mathematics chooses you."
For myself and many others we never thought of any other options.
Yes, at the moment the academic job market is terrible. Most pure math doctorates will need to deal with it, though there are a few other options, though mostly in applications.
Yes, post docs seem to be a necessary step. Not entirely pleasant but not entirely unpleasant if you meet new people with new ideas.
But a lot of academics in other fields are also "idea driven". It is a great life if you can manage to get in the door. People pay you to think. Not much could be better than that.
And, It is hard to predict what your career path might be several years in the future. Things change. When I started grad study the future looked extremely bright for PhD mathematicians. But the successful moon landing ended all of that and universities discovered they had already hired too many people and the faucet immediately closed. Overnight, essentially.
But the opposite can also happen. Some new challenge can open doors that nobody saw before. In CS, AI and data science has had something of that effect recently.
If you really love something, try to do that and try to avoid substitutes even if you need to compromise for a while as you build a reputation.
Let me add that I'm not implying that some people are "fit" for math and others are not. That isn't true, at least in my experience. It is a matter of desire and training as well as hard work. To repeat a comment made to another answer here (and elsewhere on this site): My teachers wanted to hold me back a year, primarily for poor performance in math at about age 10 (My mom saved me from that one). My first truly positive educational experience in any area was a high school geometry class. I really liked solving those problems and bought problem books to have more to solve. I finally learned my multiplication tables after earning a doctorate in math. There were other struggles along the way, but each defeat caused a renewed effort to succeed. Luckily I had good mentors.