There are springs and there are springs. The alloys used to make your car's springs do not equal the alloy(s) used to make shotgun striker springs, which do not equal the alloy(s) used to make your pistol's magazine springs, and YOU ARE GLAD OF THAT. The three examples are similar ONLY in that they store/dissipate energy on demand. BEYOND that, they are no more similar than an eggplant is to broccoli is to carrots.If leaving a spring under tension would cause it to fail, my 86 Chevy, which has had its suspension springs under tension for 35 years, would be sitting on the frame because the springs would have failed. But they haven't.
Alloys enabling springs to be compressed then released immediately tend not to stay under heavy loads for long periods of time (years) without "taking a set". Alloys used in springs meant to remain compressed then released without "taking a set" tend to be more brittle and will eventually fail if tasked often enough. The two characteristics tend to be conflicting, and these attributes may be complimented or attenuated by the geometry of the springs. Gun makers must make compromises when determining spring characteristics, and this is one of those situations.
I know of firearms which have sat with "cocked" springs for five years, worked when needed, then continued to work well past the life of their original owners. I know of one firearm (n.i.b.) which sat with no load on its hammer spring for years and broke or became non-functional before the first box of ammo went through it. These are extreme cases, but more common than some might believe.
DO play the odds cautiously, and DO NOT leave hammerless shotguns cocked if there's a way not to.