There is a law in California that has been interpreted to mean that all clubbing weapons are illegal. So if you by a length of pipe and keep it around (e.g. under your bed) explicitly for self-defense purposes, you have committed a crime.
IANAL, but as far as I can tell, keeping a shotgun in your home for self-defense purposes would be fine, as long as you aren't planning ahead of time to use it as a club.
[edit]
My information is slightly out-of-date; there was an injunction against enforcement in 2024 from Fouts v Bonta. I have no clue the injunction is or is not still in effect, so ask your lawyer before carrying a club.