Disconnect removable media from power I connected peripherals to my Mac via USB. When I put my Mac to sleep, the external microphone, for example, is still supplied with power.
Is there any way that once the Mac goes to sleep, that it will remove power from attached devices?
My idea was to use Hibernatemode 25 and that's what I did in the end.  The pmset manpage states that the RAM will be disconnected from the power.  This means that there is absolutely no possibility that the system will wake up in the idle state and start charging.  Why can't Hibernatemode 25 work and how can I turn off the power when the Mac is in sleep mode?
Not that I have seen. Apple designs the USB / Thunderbolt ports to support wake from sleep so the firmware has them always active by design. Same for providing charging of an accessory from the Mac battery or power supply.

https://support.apple.com/guide/mac-help/share-your-mac-resources-when-its-in-sleep-mh27905/mac