Somewhat related: Ssd data retention
The TL;DR being that manufacturers of drives don’t seem to generally give much indication of expected data retention times, be it hot or cold.
For source code (that presumably you’re written so of modest size?) I’d go with in order of preference, but also in order of increasing data size:
- Laser print out, human readable, OCR friendly font
- Laser print out, machine readable, 2D barcodes
- DVD M-DISC
(For those who haven’t used an autofeeding scanner, they are amazing )