I am a software engineer. I am applying to medical school this cycle or next. I am 29, an Asian male, and in an SMP right now. I am enjoying it so far.
My reasons:
Startup grind is tough.
Seeing major acquisitions and people's life change before your eyes does happen. It is not common. It takes some of the following (but not all): good pedigree, amazing self-confidence, an affinity for risk, connections, youth/time on your side (older founders are looked down upon). You need, most importantly...a product-market fit for whatever business you're launching. Very talented/smart engineers have shuttered down their companies and gone back to regular jobs after being jaded or not having the exit they wanted. Others do get that one acquisition and become set for the rest of their lives. This is not really a gamble, but the odds are against your favor, but fortune favors the bold.
From the point above, I have zero entrepreneurial skills. I went to a horrible state school, I have no connections. But more than that, I don't have the tenacity to develop those connections, and I cannot relate to the spark entrepreneurs have. So my option is basically climbing the tech ladder - which is still absolutely great. If you are a motivated person inspired by entrepreneurship, this is the field for you. Even before/after medical school. You can always change some existing market. Just look at ZocDoc as an example of an MD innovating in tech. Even MacRumors, an apple blog, is founded by a physician.
Ageism
You need to be set by 50. I don't care what anyone else says. Ageism is real. That doesn't mean you can't stop working, just that it becomes harder to keep up and make the same amount of money, comfortably, when everyone is younger than you and you're an at-will employee. The average software engineer age is like early thirties (which will go up over time - this field is exploding). Fortunately for the 22-25 year old getting started, they should have more than enough time in tech to make 3-4million+, assuming they don't do any startup stuff, if they stick to big companies throughout that time, and can then live off the dividends as they get older.
I was behind on retirement because I worked at startups for 3-4 years instead, and then 1 year of big tech, instead of just working at big tech right away and stacking that money. Even if I went back to big-tech and make 200-300k in the next year or so (and 400k+ in 2 or 3 years), I'd still be kind of behind for when the ageism years creep up. Tech stocks will continue to make gains in the coming decades and amplify your return from RSUs/stock packages given in the form of equity when you work.
Timing
My decision to begin transitioning into medicine was pre-COVID. I did not want to live in the city forever. COVID unexpectedly changed everything. If I was in the position of making this decision after COVID already happened and all these jobs stayed remote, I probably would have stayed in tech.
Non-money reasons
I love the impact physicians have. I was inspired by physicians in my own city and the kind of work they've done. I may be stupid but I want to work with people, and have an impact in my local community, away from the big city and tech bros. I don't want to be behind in sprint-cycles/development timelines behind my computer forever. I like the feeling of security and being more than employee #<insert number>. I was beginning to hate coding because it was mired in bureaucracy and I was just another robot. The challenges left me uninspired. After being an early employee and excited to work on cool things, after 4-5 years of this it just became a job devoid of meaning (to me at least). Nobody truly cares about what you do, as long as you can bring results. As such, this work is transactional.
I understand medical school is a huge opportunity cost. But I've learned to look at all of these costs as a part of a process. An extra million or two at a decade of age or younger is great, but I found the destination is just as important as how you get there (stupid cliche I know).
I know I rambled a lot but there's my reasoning when you inject a personal view into tech vs medicine. There is nothing wrong with either. If you're 21 and want to make the most out of your 20s, tech is there. You can do all the things you want and make a ton of money and within 4 years you will make well over 300k a year and can retire by the time you're 40-45.
In my gap year I will be returning to tech.