I ran across this while researching a different matter; it's § 54-211(a) of the Village Code of New Lenox, Illinois, on the outskirts of Chicago (emphasis added):
(1) It shall be unlawful for anyone to do any of the following acts within the corporate limits of the village:
a. Hunt, with or without the aid of a weapon or other device, any animal.
b. Trap, with or without the aid of a trap or other device, any animal.
c. Possess or display any loaded weapon.
(2) For purposes of this section, the term "weapon" shall mean any BB gun, pellet gun, firearm, pistol, revolver, rifle, shotgun, stun gun, taser, slingshot or bow and arrow.
720 Ill. Comp. Stat. Ann. 5/24-10 does expressly provide that "It is an affirmative defense to a violation of a municipal ordinance that prohibits, regulates, or restricts the private ownership of firearms if the individual who is charged with the violation used the firearm in an act of self-defense or defense of another ... when on his or her land or in his or her abode or fixed place of business." But mere home possession for possible future self-defense purposes is not a defense. Presumably one has to keep the gun constantly unloaded until one is faced with a situation where "he reasonably believes that such conduct is necessary to defend himself or another against such other's imminent use of unlawful force." (720 Ill. Comp. Stat. Ann. 5/7-1.) There are exceptions for possession by various law enforcement officials and security guards, but not for ordinary citizens. Nor is the law limited to possession in a public place.
The provision is in a section titled "hunting and trapping," so it may well be that the village didn't intend to ban all possession of loaded weapons. But the Illinois rule appears to be that, though the title may provide part of the context for interpreting a statute, "'If the meaning of any particular phrase or section [,] standing alone[,] is clear[,] no other section or part of the act [including the heading] may be applied to create doubt.' Reading a provision in context does not give one a license to disregard the clear language of the provision itself." Illinois Bell Telephone Co. v. Illinois Commerce Comm'n, 840 N.E.2d 704, 712 (Ill. Ct. App. 2005).
Fortunately, the penalty is a fine of $25 to $750, but the crime is a misdemeanor, which might well have other indirect legal effects (e.g., to enhance future sentences for other crimes on the grounds that the person has a criminal record). Washington, D.C. had a similar ban on possession of a loaded firearm, which possibly did not have an imminent self-defense exception, but it was repealed in the wake of D.C. v. Heller.