A public nuisance may be abated without civil action by any public body or officer as authorized by law. Any municipality, county, or township may defray the cost of abating a public nuisance by taxing the cost thereof by assessment against the real property on which the nuisance occurred or against the real property abutting or adjoining the unrepaired sidewalk as set forth in §