Storing bicycle helmets...will temperature affect the performance of the helmet?
The cold won't hurt it -- foam is used to line refrigerators.  And certainly if the temp is going "all the way down" to 40F (shudder!) that's not even close to a problem -- around here it isn't even "cold" unless the temp is below zero F.  (In general, solid objects are not damaged by cold, though they do often become more brittle while cold and hence more apt to be damaged while in that state.)

High temps could be a problem, but again foam (very similar to the stuff used in helmets) is used to insulate homes, where attic temps may reach 150F or so, and it's used to insulate water heaters that run at 180F.  The problem is that extended high temps over, say, 150F,  won't degrade the rigid foam itself, but they will degrade the glues and the foam rubber liner.