And I just noticed that @felmue has an Arduino example of exactly that here: https://github.com/felmue/MyM5StackExamples/blob/main/M5StickCPlus2/SleepAndPowerOffTest/SleepAndPowerOffTest.ino