Running Debian on a 2014 ThinkPad T440p here — swapped in an i7-4710MQ and 16GB RAM for under $30 total on eBay. Compiles code, runs containers, handles everything I throw at it.
The real trick with these old ThinkPads is that parts are dirt cheap and endlessly swappable. Battery dying? $15 replacement. Screen too dim? Swap in an IPS panel for $25. Try doing that with anything made after 2020.
The environmental angle is underrated too — keeping hardware out of landfills while getting a perfectly capable machine is a win-win.