Amid a Bay Area real estate market famous for its mind-boggling home prices, taxpayers are funding a little-known special perk for a very select group of house hunters: low- and sometimes no-interest loans for top local government employees.

While most of us are stuck turning to Bank of America or Wells Fargo for market-rate mortgages, an exclusive group of the region’s public-pay elite — made up of mostly city managers, a few school superintendents and even the head of a sewer district — are tapping public funds for sweetheart housing-assistance deals that in some cases exceed $1 million.

A first-of-its-kind survey by this newspaper found that at least 33 government agencies in the Bay Area provide some type of housing aid to their top executives — with sweeteners, enabled by special IRS regulations, that are virtually unheard of in other parts of the country or the private sector. Four cities — Walnut Creek, San Bruno, Union City and Morgan Hill — even have provided housing aid to rank-and-file employees.

In addition, this newspaper’s investigation found that when real estate prices go up, so does the generosity of the housing perks.

For example, Palo Alto Unified School Superintendent Glenn “Max” McGee said he couldn’t manage to buy a condo with the $1 million interest-free loan the district gave him when he moved here from Illinois last year. So the school board voted to increase the loan another $500,000 — enough money to employ about 16 Palo Alto teachers for a year, compensation data shows.

The school board is scheduled to finalize the deal Tuesday.

“We don’t give public officials a food subsidy because food costs more in the Bay Area,” said Atherton resident Peter Carpenter, a vocal critic of housing assistance, especially below-market-rate loans. At least, he said, the loans “have to be pegged to the going mortgage rate.”

However, they’re usually not. McGee’s loan is interest-free — a huge money-saver, even though his salary and out-of-state pension total $530,000 a year.

In the North Bay, Tiburon Town Manager Peggy Curran paid only 0.26 percent interest — $2,080 — on her taxpayer-funded $800,000 mortgage for the past 12 months. Her variable interest rate just rose to 0.33 percent. In the East Bay, Richmond’s tiny West County Wastewater District paid more than $400,000 into the house of General Manager E.J. Shalaby, whose pay and benefits last year topped $317,0000.

Consider bidding against them for that dream home with cedar shake shingles, hunter green shutters and a six-burner stove that would make Alice Waters smile.

But Palo Alto is the focus of the biggest dose of housing-perk envy in the Bay Area: Aside from McGee, City Manager James Keene has the Windsor Castle of housing deals. The city agreed to loan Keene $500,000 at a variable interest rate — as well as put up $1.5 million for his home purchase, with an agreement to share in equity. In 2013, the city also agreed to loan Keene as much as $125,000 for home improvements, provided he puts up an equal amount.

Today, Zillow estimates that Keene’s house on Webster Street would sell for $2.8 million. He already was one of the region’s highest paid officials in 2014 with salary and benefits topping $433,000. He did not respond to requests for an interview.

Keene’s predecessor, Frank Benest, had a similar housing deal, and the city agreed to allow him to stay in the house after he stepped down in 2008 until his children finished school. But the house burned down in a three-alarm fire last year, and now the city and Benest are working with his insurance company on a plan to rebuild.

Do these deals seem fair? They don’t to government watchdogs.

“The whole thing makes no sense,” said Thomas Schatz, president of the Washington, D.C.-based advocacy group Citizens Against Government Waste. He said he knows of no other part of the country that so generously doles out housing assistance to government employees. “People are going to be surprised by this and say this is just another example of municipal governments wasting money.”

This newspaper found that local Bay Area agencies provide housing assistance to 19 city managers, as well as police chiefs in Atherton, Berkeley and Richmond, San Rafael’s fire chief, department heads in Sunnyvale, a government lawyer in San Mateo, a recreation director in Cupertino and others.

At least two cities — Albany and the Marin County town of Belvedere — offer their top managers assistance only if they move to town, but both have so far declined. Redwood City recently paid $16,000 in housing costs so its outgoing city manager would stay two additional months.

San Jose made 22 housing loans of $250,000 each to government employees from 1999 to 2009. However, it stopped offering loans in 2009 after the City Council was criticized for forgiving a loan to former Independent Police Auditor Barbara Attard when her condominium’s value sunk below what she paid for it.

“I don’t think these loans are good public policy at all,” said Pete Constant, a former San Jose councilman. “They are always provided to the highest members of the organization who make double the average employee. And there are a number of times when government agencies have been burned.

“Government’s job is to provide basic services,” he said. “Giving housing loans to top people isn’t providing a basic service.”

No one in the elite club has a better deal than McGee, who said in an interview that the Palo Alto school board offered him a $1 million, zero-interest housing loan without him even needing to ask when he first took the job. However, he said, it wasn’t enough to buy a house in a city where the median home price tops $2.4 million, according to Zillow, and has shot up 19 percent in the past year.

“I couldn’t afford the down payment” required with commercial mortgages, said McGee, who then asked for another $500,000 from the district — and got it. “We looked at two condos for $1 million, but they needed a lot of work.”

Why, given his high income, did McGee need so much help? “I am not going to get into my personal finances. We help care for a large extended family.”

Board of Education President Melissa Caswell said that McGee moved from the Chicago suburbs and was “shocked by the home prices here. He really had no idea.” She called the $1.5 million loan reasonable, given the market.

So did resident Mark Harris, the city’s retired finance director: Needing help financing a house in Palo Alto “isn’t a shock to anyone who has any sense of what’s going on here.”

McGee’s deal is similar to the lucrative agreement the district gave to his predecessor, Kevin Skelly, except in two important details: McGee’s loan is 50 percent bigger. Also, if the home he buys appreciates during his tenure, the district will get half the equity when it’s sold. It had no such split with Skelly, or previous superintendents.

Skelly’s $1 million interest-free loan didn’t require him to pay back a penny until his tenure ended seven years later. He had combined the loan with a traditional mortgage to buy a $1.8 million Palo Alto house in 2007, records show. He sold it for $2.2 million when he resigned last year and paid off the loan. The equity gain was his to keep.

“I was anxious to live in the district,” said Skelly, now superintendent of the San Mateo Union High School District, which doesn’t pay any of his housing costs. “I don’t know that (the loan) was unusual.”

No-interest loans, however, are rare. A member of the public given a subsidized mortgage would have to pay taxes on anything less than what is known as the Applicable Federal Rate for long-term loans. The rate for this month is 2.65 percent, according to the IRS. But municipal government employees are exempt from such taxes when their employer gives them housing loans under a 1986 IRS regulation, said Stanford law professor Joe Bankman.

That’s a big reason these types of loans and equity shares need to be clearly labeled as compensation and rolled back, said Jon Coupal, president of the Howard Jarvis Taxpayers Association. “It’s just a way to pad compensation. It’s just a rat’s nest.”

More common are low-interest loans tied to government investment funds. That’s how Curran, the Tiburon town manager, ended up paying only 0.26 percent for the past year on $800,000 she borrowed from the town for a house just outside the municipal limits.

The rate equals the return on a fund managed by the state treasurer’s office and is capped at 5.5 percent, but it doesn’t have a bottom. In fact, it has been below 1 percent since mid-2009.

“I have benefited from this,” Curran said. “The worse the fund does, the better I do.”

But when she retires next year, she will owe Tiburon a lot of money. “I have to cough up $800,000 to pay that puppy off” by either selling the house or borrowing the money elsewhere.

When the economy tanks and real estate values plummet, taxpayers can be left in debt, too. Former Santa Clara County Schools Superintendent Charles Weis borrowed nearly $900,000 in no- and low-interest loans from the county office of education for a luxury condo.

But when it went under water in the Great Recession, Weis walked away from the loan, skipping months of payments. The county board of education sued Weis in 2012 and settled two years later, but it failed to recoup all of what Weis owed. Taxpayers lost more than $220,000.

In addition to putting taxpayers’ money at risk, Schatz, the Washington-based government watchdog, said housing deals for high-ranking and well-paid government officials are wrong in principle — and as ripe with irony as they are with questionable use of tax dollars.

“I thought the purpose of government lending programs was to help people,” he said — people “who otherwise couldn’t afford a house.”

Database producer Daniel J. Willis contributed to this story. Follow Thomas Peele at Twitter.com/thomas_peele.