Initially I had some thoughts to go for use of a custom memory or an abuse of some config of any of the sensors. Unfortunately, none of the devices offers general purpose custom memory, and abusing a config value - for example of the GPS - is living on shaky grounds. Even with later option, data survives a power cycle only when written to permanent storage, which is also flash memory. (By the way, the GPS device uses the same concept of writing the RAM config to FLASH on demand / defined events. GPS power is controlled by the software and since an active GPS runs the battery down in less than 10 hours, it is not really an option. GPS has option of separate power for retaining current config and data in RAM, it is not wired that way.)
Last alternative would be modifying the hardware... but I can tell you that regular soldering on no-lead devices with 0.2mm 'pins' of 0.4mm pitch is a challenge. I just recently tried to hookup a TDFN 14 3x3x0.75mm package. After many attempts I got it, but then 'hit' the 0.2mm wires when mounting it on a carrier and gave up. Even if you get connectivity - for 4 to 5 wires (or 6 wires with power control), you still need to find space for a serially controlled, non-volatile memory other than flash. There are such memories: see my post(s) about 256-Kbit (32 K × 8) Serial (SPI) F-RAM - Ferroelecric RAM - SPI challenges. That was 6+ years ago... and I'm sure there are now more suitable chips - and technology - out there, that also have better life cycle: MRAM.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Initially I had some thoughts to go for use of a custom memory or an abuse of some config of any of the sensors. Unfortunately, none of the devices offers general purpose custom memory, and abusing a config value - for example of the GPS - is living on shaky grounds. Even with later option, data survives a power cycle only when written to permanent storage, which is also flash memory. (By the way, the GPS device uses the same concept of writing the RAM config to FLASH on demand / defined events. GPS power is controlled by the software and since an active GPS runs the battery down in less than 10 hours, it is not really an option. GPS has option of separate power for retaining current config and data in RAM, it is not wired that way.)
Last alternative would be modifying the hardware... but I can tell you that regular soldering on no-lead devices with 0.2mm 'pins' of 0.4mm pitch is a challenge. I just recently tried to hookup a TDFN 14 3x3x0.75mm package. After many attempts I got it, but then 'hit' the 0.2mm wires when mounting it on a carrier and gave up. Even if you get connectivity - for 4 to 5 wires (or 6 wires with power control), you still need to find space for a serially controlled, non-volatile memory other than flash. There are such memories: see my post(s) about 256-Kbit (32 K × 8) Serial (SPI) F-RAM - Ferroelecric RAM - SPI challenges. That was 6+ years ago... and I'm sure there are now more suitable chips - and technology - out there, that also have better life cycle: MRAM.
Last is to change the hardware completely - but I guess this is really not an option here: ti - Texas Instruments - has micro controllers that use FRAM as (some of their) RAM: no need to save and restore: 'it' - data - is just always there. See https://www.ti.com/microcontrollers/msp430-ultra-low-power-mcus/products.html with a particular chip that has only FRAM as RAM: https://www.ti.com/product/MSP430FR6007 - and a typical application: metering of services that cannot loose data under any circumstances... - Memory alone: https://www.cypress.com/products/excelon-fram - and particular product with package small enough to fit: https://www.newark.com/cypress-semiconductor/cy15b104qi-20lpxc/fram-4mbit-0-to-70deg-c/dp/39AH1712?mckv=smaXxg4SK_dc|pcrid||plid||kword|cy15b104qi-20lpxc|match|e|slid||product||pgrid|1224856154107520|ptaid|kwd-76553668726599:loc-190|&s_kwcid=AL!8472!3!!e!!o!!cy15b104qi-20lpxc&msclkid=9b857f5944fc1e7d3e2820dc434f3791&CMP=KNC-BUSA-GEN-SKU-Semiconductors-ICs-07
NB: Have no financial interests in any of related organizations or businesses.