One thing I have not heard is take the mystery out of the gun. Introduce your child to the handgun and any other guns you have. Teach them that it's not a toy and to never mess with it. I know that some parents are against spankings but the worst whoppen my boy ever got is when he decided to mess with a 22 with out permission (it was behind a closet door and unloaded). Let them shoot the 22s or 9mm when they are big enough.
I guess what I am saying is teach then proper gun safety and if they are around guns and shoot guns on the weekend or when ever then I my opinion the gun is not a big secret that daddy is trying to hide, and they might be less likely to go looking for it or to mess with it if they come across it.
Edit to add that your home defense gun still needs to be out of reach of any small child be it your own or visitors. It's just not worth the risk.