The fix is actually simple: shoot at a light bulb. It will think you always hit. I figured this out accidentally as a kid one day when I was randomly firing around the room and hit a duck.
I haven’t tested this with Duck Hunt, but I believe most NES Zapper games actually detect this exploit by blanking the screen for one frame before drawing the target in white, and checking that the gun saw one dark frame followed by one light frame.