On a beautiful Sunday afternoon some speculation. Read an article about "smart guns"--the idea being that the gun and the owner would be tied together by some means--biometric perhaps, i.e., fingerprint. People are working on it, but it's difficult to make it relatively foolproof, particularly when the concept faces hurdles gaining acceptance in the market.
There are also some laws/proposals for requiring gun safes. It seems as if the people who would follow such a law are among the people least likely to need it, though keeping guns away from youngsters tempted to play with them while the parents are away is worthwhile. Reduce gun deaths by preventing accidents, if not homicides.
How about using bluetooth and the internet? Sell guns with an associated gun safe which can sense the presence or absence of the gun. That should be easy enough. Then have the gun safe wifi-enabled with an app on the smartphone. So one or more people could be sent alerts when the gun is removed from the safe. Such a notice would help in cases where a child/teen/burglar removes the gun.
The idea wouldn't prevent many cases, but some. Not sure if 2nd Amendment types would go along, but some might.