Plenty of lucrative and fulfilling options.
I got my PhD ~20 years ago and saw a few tenured professors (math and physics) leave academia. While I have no first hand experience I did hear through a grapevine that some explored options for coming back, but could not. This is a sensitive topic with little data and so my info is certainly suspect.
If they are successful at a top university and leave to try other things (usually startups), then they will have no problems going back to academia. Sometimes it is even viewed positively.
For example, right now Carnegie Mellon has been seeing a flock of their faculty leave to go to tech companies or to do their own startups. Other universities would fight over a successful ex-CMU (or UW!) prof to come to their institution.
Depending on their level of success, they may not get back to a top 5 university, but some other R1 university would gladly take them!
I would likely have a lot of trouble re-entering academia due to lack of recent academic publications; I've been on many hiring committees over the years in pure math, and we never considered hiring anybody who wasn't already in academia.
My reasons for asking... I've heard mathematics academia has its own version of ageism. (In dotcoms, at least, it's easy to go from being a star who everyone wants to hire, to most people not caring.) Plus I wonder how it would be perceived: a history of seeming to want to do a startup rather than be a professor. And a university that wanted to be the new home of a prestige research&eduction open source software project would have to see whether the prior university's involvement would complicate things.
Pretty sure this is false.