57M here and still love coding.
Ageism is very real - but so is the tech shortage. So it's a good time to be a greybeard. I was at a Google event a few years back. A colleague (53M) expressed to a Google PM his interest in coming to work for Google. The PM said bluntly "Google doesn't hire people over 50".
The employee average cost-benefit curve inverts at 40. At least that's what the beancounters will say.