But don't listen to what the internet supposedly says, or what any of these companies say (at least not without a heavy dose of salt). Or let the stigma this incredibly immature industry has against people who take sabbaticals or necessary health breaks "stick" to you in any way.
If programming is something you love -- just get back "in the ring", as they say. Even if it's just building stuff for yourself, or working on open source projects, or pro-bono projects for organizations you support (if you can afford to take the time to do so). It shouldn't take more than 6 months to get your memory muscles back in fully working order -- likely even stronger than before (as the shift in perspective can actually help the learning process).
Career breaks are healthy things, not bad things (or a sign of failure/weakness) the way the industry propaganda makes them out to be.
I've stepped away from coding for over a year, and a few profound things happened. Firstly, I could once type at around ~120 wpm, after my hiatus that dropped down to 40-80, and has been down there ever since (over a decade.)
Secondly, I couldn't get myself to sit the f-down and just do the work, not for a long while anyway (longer than one thinks it should.)
I became a less conventional team dev and a sort of a code ronin. My skill for systems design and abstraction have grown and enhanced yet I have never again known the enthusiasm for the grind I had in my earlier days.
So yes, I can see how someone discouraged or ready to move on could "leave it all behind." Though I have seen how there are cycles for everything and some things merely turn into something else in their own due time.