I'll nention it for completeness sake: another possible solution, albeit a bit cumbersome, would be to get a regular contract-free plan but suspend it for the period you don't need it.
A cursory search indicates that both Orange and Bouygues (as well as their contract-free offshoots, Sosh and B&YOU respectively) still offer this as a paid option at 5€ and 7€ per month respectively.
This means you could get the plan appropriate for your needs, then suspend it (for at most 6 month per year it seems) and only reactivate it when you need it.
However since this procedure requires getting in touch with customer service, it should be reserved for people well versed in French :-)
A cursory search indicates that both Orange and Bouygues (as well as their contract-free offshoots, Sosh and B&YOU respectively) still offer this as a paid option at 5€ and 7€ per month respectively.
This means you could get the plan appropriate for your needs, then suspend it (for at most 6 month per year it seems) and only reactivate it when you need it.
However since this procedure requires getting in touch with customer service, it should be reserved for people well versed in French :-)
Edit: adding links (all in French)
https://www.echosdunet.net/dossiers/suspendre-ligne#suspensi...
https://assistance.sosh.fr/faq/308268
https://www.assistance.bouyguestelecom.fr/s/article/suspensi...