there was a time when bathroom shaver sockets were designed for intermittent use measured in minutes per day, the isolating transformer only being energised when a plug was inserted.
toothbrush chargers may be plugged in for many hours, or permanently, and it was warned that this could lead to overheating with no "off" period to cool down.
It would be a good idea for modern shaver sockets to be designed to accomodate this usage. Perhaps they have been.
I've never had such a problem. I have had rechargeable shavers since the early 70's and always recharged them in a shaver socket.