The term and slang “40” was popularized in Chicago, Illinois as a word referring to handguns and the gun’s caliber.
A 40 is any weapon (handgun) with a .40 caliber.
The term “40” has been used by Joe Trufant, RondoNumbaNine, Montana of 300 and many more rappers.
Purchase a Rap Dictionary Book
Read: What does “Drip” mean in rap?
Read: What does “Cap” “No Cap” and “Capping” mean?