This is a fun question.
I have to assume the absolute ideal would be some sort of water flow detection right in line with the shower head. Likely hard wired. But like I said, that’s an ideal.
I think the other suggestions in the thread are reasonable. The microphone one seems most appealing to me since that could theoretically just occupy an outlet anywhere in the room.