Helmets.org seems to have a lot and up to date info on bike helmets. It seems almost unintentionally ironic (and I stress that it is not their intent; they are very serious and thorough) because the "known and unknown unknowns" of helmet science are so vast. Apparently, there is a shortage of experimental volunteers.
But it does seem to be the case that most modern helmet foams have a very long life.
YMMV.
For example, I decided my wife deserved a new helmet for our new ebike when I saw that the mfg date on her old one was 2000. She is kinda special to me, even though she hasn't ridden much in the last 10 years or so.