There is a 90-day visa on arrival, and then it can be extended once in the country, and then maybe there are other ways to extend it again?
All told, what is the longest continuous or nearly continuous time I could stay on a tourist visa in Nepal?
300 days, from early August to late May, with 150 days in each year.
Here's how: A tourist visa-on-arrival is given for 90 days at the border and can be extended to up to 150 days per visa year in the Department of Immigration office in Nepal. The visa year is incidental with our (Jan - Dec) calendar year. So by entering the country 150 days before the end of the year, you can stay until 150 days into the new year as well, together 300 days.
For reference, see for example this page of Nepal's embassy in Japan:
The tourist visa shall be granted for a period in maximum of 150 days in a visa year (Visa years means January to December). […]
If any foreigner who has entered into Nepal towards the end of a visa year desires to spend even the period during which he may stay in Nepal with the tourist visa of the other visa year, he may use such facility. Provided, however, that the computation of the fees for such period shall be made on the basis of the total period of his stay.
In practice, there might of course be issues with this approach, so be sure to have a short-term backup plan (such as an e-visa to India) in case that extending your visa fails and you have to leave Nepal. For example, I read that if you are extending a visa towards the 150 days per year maximum, they will ask you for a flight ticket that will prove that you will indeed leave the country. That should not be an issue given the visa regulations cited above. But then again, it's not clear what "entering Nepal towards the end of the visa year" means in practice.