In a house I owned a few years ago, i installed a small tank type heater.
The reason I did this was because the bathroom was a long distance from the main water heater and it took a long time for the hot water to travel from the tank to the taps. So, I bought a small tank heater from Home depot and installed it in the crawl space under the bathroom, where all the plumbing was, and it supplied only the bathroom.
The disadvantage was that if I took a really long shower, it would take a few minutes for the tank tor recover for the next person. Generally we found it took 15 minutes, so getting ready to go out was usually a carefully balanced issue if we both needed showers.
The advantage was that I wasn't keeping a big tank full of hot water when we were away. In fact I installed a switch to turn off the heater when we left the house, after the last shower. Then when we needed the hot water in the bathroom again, I could just flip it on, wait 15 minutes and it was fine.
In my situation this was also an advantage because I only had a 200 amp service, so I was able to wire it into the same circuit that the dryer was on. My switch, noted above, was a double pole switch that switched the power to EITHER the hot water heater OR the dryer.
A couple of months later I installed a similar switch for the main hot water heater and we got quite used to the habit of turning the switch off when we finished with the dishes, etc.
It worked well for us.