It undoubtedly uses more energy to leave a computer on than to turn it off. A PC will draw a few hundred Watts when on, compared to a few Watts powered down but plugged in.
The biggest hardware failure issue (and the one in the accepted answer to the linked question) tends to be hard drives, potentially leading to data loss as well as the need for hardware replacement. This is much more of an issue with spinning-disc hard drives than solid state drives. Even then an HDD would be unlikely to fail during the typical lifetime of a PC, so it's more of an issue for big server systems with many (heavily-used) drives. Desktops and all but the smallest laptops have replaceable hard drives, so you wouldn't need to replace the whole PC.
Other components shouldn't have likely failure modes from power-cycling, though it's not completely unknown for desktop power supplies to die after a few years and they tend to demonstrate this by failing to start (but that still doesn't mean frequent restarting causes the failure).
So theory would suggest you're always better turning it off. Turning off can also remove some chances for accidental damage.
In practice: I've had desktop PCs of my own for a little over 20 years, and work-issue desktops for almost as long. Unless banned by the employer or using the machine for a long task I shut down overnight - so that's over 10000 overnight shutdowns. I've only had a few hardware failures over that time, and none that could be blamed on power-cycling as such. Most were accidental damage*, but I had one motherboard that killed power supplies coming out of standby (but not from cold boot, so powering off arguably saved hardware) and that was over 15 years ago.
* Dropping a powered-on machine can be bad for an active disc drive even if nothing else is broken so powering down (or using standby) is likely to save hardware. Spilling beer/coffee on stuff isn't good for it whether on or off; you may damage more components if you spill drinks on something that's powered up.