Update here.
Last year it started getting worse. I'd re-light the pilot, but it finally gave out to the point where it wouldn't re-light. So we looked into what to get once we could afford a replacement. I just shut off the water to it and kind of lived without running hot water, although now it's kind of hard to take a shower at the gym since it's closed.
So we had a plumber come in for another issue and we asked about installing a water heater. My wife heard from a friend who recommended Bradford White, which only sells to contractors. Earlier we were thinking of maybe buying a water heater at Home Depot or Lowe's, getting it delivered, and having a plumber come in to install it and then take away the old heater. When asked he said he could order a Bradford White.
Later we contacted him again to get an idea of when he could do this and have a look at our home's setup. We figured he'd know enough about these to know what features were needed. I didn't get all those those little differences. He had a look at our setup to see what would be needed. He ordered a 40 gallon Bradford White Eco Defender water heater with a direct vent and a Honeywell V2 gas control unit. I haven't seen one quite like this before since there's no pilot door. It looks like everything is done through the gas control unit, including a built-in (manual) piezoelectric igniter like the ones in kitchen lighters or some of my camping stoves. At this point I have no idea how good this water heater is, but the plumber said that Bradford White is very good.
The plumber spent over a day doing it. Of course a new gas connector as well as new copper tubing for the bypass (I could smell the solder upstairs as he was using a blowtorch. Also - he installed an aluminum water heater pan under it. The job seemed to be done competently.
The only issue I have now is that the building office isn't open for permits. I guess this could be classified as an emergency where we can get the permit after the fact once they're open again. As far as I can tell the big thing is that they need to be able to inspect the work.