If you're anything like me, this will have enduring positive benefits on both your personal happiness and lifetime earnings.
A sabbatical is an investment in yourself, and by definition not a cheap one. Although depending on who you are and what you want to do with it, it doesn't have to come 100% out of one's own pocket.
A great sabbatical would be teaching children, or underrepresented adults. That will affray expenses, and gets you in on a group buy for health insurance, for those of us stuck with that problem.
Still, it's not available to everyone, I don't want to dismiss that. I'd like to see it possible for more of us. This is not an industry which is short of wealth, and a nonprofit which helps match mid-career software people with sabbatical opportunities, scholarships, and so on, would be a welcome addition to the landscape.