Thanks everybody for your suggestions, very helpful!
I had seen references to EEPROM before but it didn’t seem to be available, but this time on the tutorial page shared by @cgwaltney it actually mentions that nowadays you should use Preferences (ESP32 Save Data Permanently using Preferences Library | Random Nerd Tutorials) and that works flawlessly.
I haven’t really tried what was suggested in the post shared by @PJ_Glasso because it seems similar to what I was doing (using RTC_DATA_ATTR and I do close the Serial port before sleeping) and there the variables don’t survive a power out or even a hard reset.
Btw this part of the ESP32C6 documentation seems to suggest that the board does indeed lose data marked with RTC_DATA_ATTR after a power outage: “In ESP32-C6, there is only RTC FAST memory, … It will be kept powered on by default.”