I have a problem with certain family members and exceedingly long showers. Pleading and screaming has no effect. The water bills and the gas bills are outrageous.
I've seen some commercial products that control long showers but they are poorly reviewed and expensive.
I was thinking of a solenoid controlled valve on the hot water line of the shower. I'd plumb in a bypass to keep a tiny amount of hot water going in, but cut off the bulk of the hot water with a valve like this: (rated to 80°C).
To trigger the micro-controller that controls the valve I'd use a flow sensor such as (rated to 100°C). A dishwasher valve would also work.
So basically it would be a flow sensor and a solenoid controlled valve in series with the hot water line, and a bypass with a manual valve.