Academia is an option. I was in a similar situation to you early on in my career and decided I wasn't happy in industry, and decided to enroll in grad school. I ended up teaching for a couple of years and found that I really enjoyed it. And the kind of work you do on research projects is very different from that of the corporate world - you can focus on longer-term things with less immediate results, the work itself can be super interesting, and there are always lots of interesting people around in a university environment.
Academia has its downsides however - the job market is brutally competitive, it can be very hard to get research funding, and you can spend a lot of your time writing grant applications. There's also admin duties to take on which can eat up more time. It also has bureaucracy and since it's an institution comprised of people, is not immune from many of the interpersonal conflicts that occur in the corporate world.
I'm speaking from the Australian perspective here, but in my country the universities also decided to sell out and take in lots of international students who have $$$ but lack sufficient background knowledge and motivation, and lecturers are forced by the universities to let students pass who haven't demonstrated sufficient competency. I was asked to change marks on a course to reflect the number of students who the university wanted to pass, not how many were actually worthy of it, which I felt was unethical. Because of all these issues I decided academia wasn't for me so as soon as I had my PhD I got out. I still miss the actual core teaching part though, as it's one of the most enjoyable things I've done.
So I ended back in industry where I'm back to building software, but in a role that lets me use what I learnt in grad school and is thus more interesting than just building basic web/CRUD apps. Not all companies are bad, and I've been lucky enough to find an employer where the bureaucracy is minimal and my manager makes sure I'm pretty well isolated from the things which get in the way of actual work. There are good companies out there, but it takes a certain amount of luck to end up in one with a healthy culture.
One other piece of advice I have is that if you're from a rich western country, move to somewhere with a lower cost of living and work remotely. I relocated from Australia to Thailand and it approximately quadrupled my spending power. This gave me the freedom to be able to take time off from my job more often to do other things like work on hobby projects, and while I don't currently take advantage of this freedom much it's nice to know its there. Depending on who you're working for, you might be able to negotiate a part time gig, or if contracting do six months on, six months off or something like that.
Oh, and on going it alone and trying to be an indie dev: this can be super tough if you don't have good business and marketing skills. I tried this and failed. Others have made it work, but it's definitely not easy.
IME academia as a job truly sucked, but now that I get my money elsewhere, academia as a hobby is an awesome thing(!) and helps me keep a balanced mind.
Academia has its downsides however - the job market is brutally competitive, it can be very hard to get research funding, and you can spend a lot of your time writing grant applications. There's also admin duties to take on which can eat up more time. It also has bureaucracy and since it's an institution comprised of people, is not immune from many of the interpersonal conflicts that occur in the corporate world.
I'm speaking from the Australian perspective here, but in my country the universities also decided to sell out and take in lots of international students who have $$$ but lack sufficient background knowledge and motivation, and lecturers are forced by the universities to let students pass who haven't demonstrated sufficient competency. I was asked to change marks on a course to reflect the number of students who the university wanted to pass, not how many were actually worthy of it, which I felt was unethical. Because of all these issues I decided academia wasn't for me so as soon as I had my PhD I got out. I still miss the actual core teaching part though, as it's one of the most enjoyable things I've done.
So I ended back in industry where I'm back to building software, but in a role that lets me use what I learnt in grad school and is thus more interesting than just building basic web/CRUD apps. Not all companies are bad, and I've been lucky enough to find an employer where the bureaucracy is minimal and my manager makes sure I'm pretty well isolated from the things which get in the way of actual work. There are good companies out there, but it takes a certain amount of luck to end up in one with a healthy culture.
One other piece of advice I have is that if you're from a rich western country, move to somewhere with a lower cost of living and work remotely. I relocated from Australia to Thailand and it approximately quadrupled my spending power. This gave me the freedom to be able to take time off from my job more often to do other things like work on hobby projects, and while I don't currently take advantage of this freedom much it's nice to know its there. Depending on who you're working for, you might be able to negotiate a part time gig, or if contracting do six months on, six months off or something like that.
Oh, and on going it alone and trying to be an indie dev: this can be super tough if you don't have good business and marketing skills. I tried this and failed. Others have made it work, but it's definitely not easy.