WICHITA, Kan. — Reasoning that more guns mean greater safety, Kansas lawmakers voted last year to require cities and counties to make public buildings accessible to people legally carrying concealed weapons.

But for communities that remained wary of such open access to city halls, libraries, museums and courthouses, the Legislature provided an exemption: Guns can be banned as long as local governments pay for protections like metal detectors and security guards, ensuring the safety of those they have disarmed.

It turns out that in Wichita, the state’s most populous city, and in some other towns, the cost of opting out before the Jan. 1 deadline was just too high.

“It was essentially being foisted upon us,” said Janet Miller, a City Council member in Wichita. The city applied over the summer for a six-month exemption but voted last month not to extend it after the police estimated that it would cost $14 million a year to restrict guns in all 107 city-owned buildings.