Why not put in one of those Marey gas tankless units? Same $300, saves space, and no pilot light. Even vents with standard B vent. Gas valve DOES NOT modulate, that's' why it's only $300. You must manually set the gas level yourself. Wouldn't want one as my main water heater, but for 1 bathroom not getting much use it would be fine.
https://amzn.com/B009EG4QJM
The 2.7GPM model is $232, might be enough for 1 bathroom.
https://amzn.com/B009EFVS8A