But I’ll note that $40k/year isn’t nearly enough to live on for people in their 50s unless you’re unusually healthy or someone is subsidizing your healthcare. Healthcare gets much, much more expensive with age.
My employer spends $20k towards my family’s overall healthcare consumption, and we still spend $10k out of pocket.
Regarding taking a break: what have you got to lose?
No programmer I know whose resume says “I took a year or two off to travel the world” has had any trouble getting a new job when they come back. Hiring managers will be jealous, perhaps, but not upset by your choices.