0.03 kW * 24 h * 365 d * $0.18 = $47.30/year
Even CPU TDP is not an accurate measure. My latest AMD CPU will pull more than it’s rated “TDP” under certain loads.
(FWIW, searching for the CPU model brings up an old review where the full system they’re testing pulls 145W under some amount of load. While that’s not nothing, it’s also not outrageous for a desktop PC that does the desktop PC things you require of it.)
TDP is a thermal measurement, it's how much heat energy your heatsink and fan need to be able to dissipate to keep the unit within operational temperatures. It does not directly correlate to the amount of electricity consumed in operation.
New systems idle at something like 25 Watts according to a lazy search. So 49-25=24W. That works out to $15/year hypothetically saved by going to a newer system. But I live in a cold climate and the heating season is something like half the year. But I only pay something like half as much for gas heat as opposed to electric heat. So let's just knock a quarter off and end up with 15-(15/4)=$11.25USD hypothetically saved per year. I will leave it here as I don't know how much the hypothetical alternative computer would cost and, as already mentioned, I don't care.
[1] https://forums.anandtech.com/threads/athlon-ii-x2-250-vs-ath...
I also do caching and distributed compilation with sccache.
HDD/SSD?
Pretty surprising to have this thing still be working 17 years later, unless it spent a good chunk of that in 'cold storage'.