My post was mainly answering to the OP comment and your follow-up.
> It still makes sense to use a decade-old computer.
>> I don't really think it does, at least not some of them.
I totally agree with you regarding the homelab topic (although personally, I started using low-powered refurbished x64 thin-clients (using about 10W) in place of a RPI cluster, mainly to get real sata ports on them.)
My point is that, environmentally, continuing to use a 10y computer rather than buying a new one is generally a sound advice (assuming it does still what you want it to do).
Since I didn't have data for a 10y old computer, I used what I could find: the 2016 vs the 2021 Macbooks Lifecycle assessments from Apple. The same point would probably stand between a 2010 computer and a 2023 computer. Even if the old one is less energy efficient, the 150 to 300kg+ of CO2 you save not building a new device goes a long way.
And instead of consumer devices or RPi, if you are talking about datacenter-class servers, then you save even more CO2 by prolonging your device life since a new server's manufacturing footprint is more like 1500 - 3000 kg CO2eq.
Replacing really obsolete machines used as servers by RPI does certainly makes sense power-wise (as long as you don't need storage), so not arguing with the point you make about that.
However, I agree with with the OP comment that computer should not be replaced simply because newer, more energy efficient alternatives exist: at least not for anything made after 2010.
When comparing whether it is worse it or not to extend the life of a device that still does the job its intended to do, it's almost always worth it to extend the device's life.
As an exemple, if we go by Apple's data: a 2016 13' Intel MacBook Pro create a yearly impact of 18 kg of CO2eq through usage (electricity).
The 2021 13' MacBook M1 is a better machine environmentally by all account: manufacturing it polluted less than the 2016 machine (168kg CO2 vs 386kg), and it is more energy efficient (13 kg / CO2 per year).
Still, you would need a whooping 33.6 years for the use of the more energy efficient laptop to cover the CO2 from manufacturing it. And that's using global carbon data, if you live in a low carbon grid country, it could take a century to recover the greenhouse gas emitted during manufacturing of the new laptop.
(Not saying I would not still buy a M1 over keeping the slow Mac Intel but please don't claim your are helping the environment when doing so).
At first, write clean code with functions and don’t obsess over call overhead. Once it works, profile, then optimize where it actually matters.
Premature optimization, etc.