A Michigan dad was charged with violating the state's safe gun storage law after his son allegedly got a hold of his firearm and shot himself, investigators said.
The article links to the recently passed laws which address gun storage while minors are present:
Gun owners who live with minors who could access their firearms will now be required to store the firearm in a locked box or container or lock the firearm with a locking device that renders it inoperable by any individual other than the owner or an authorized user, according to the legislation
You could probably argue that keeping it under your pillow or on your nightstand while you're sleeping or carrying it with you around the house is still acceptable since it's "in use". In the latter example, you're literally carrying it with you, and in the former example it's within arms reach at all times.
That said, should you have an unsecured gun in a house with a child? Absolutely not. They could sneak into your room while you're sleeping and easily get the gun if it's on the nightstand.
Besides, I'd expect most gun safes worth buying would be able to be quickly opened in case of an emergency. You have a decent amount of time between someone throwing a brick through a window and them being in your room. This isn't Hotline Miami. They can't see through your walls and aren't going to intentionally make a beeline for you with a golf club.
Edit: at least I hope they're not making a beeline for you. If they are then you're possibly fucked no matter what. If they're making a beeline for you that means you're the goal and that they're A) a crazy ex or disgruntled coworker/business partner, B) a kidnapper and/or extortionist, C) a hitman, or D) members of a gang or cartel that you pissed off. You might be able to defend yourself in situation A (probably the most likely situation for the average person), however they might have a gun too. In situations B, C and D, you're fucked. Firstly, a professional hitman will probably enter your house without you knowing, so it doesn't matter how much time you have to prepare yourself because you probably won't see them coming. Secondly, kidnappers, extortionists and cartel/gang members probably won't be alone and will probably be heavily armed. Even if you successfully fend them off, you'll probably get shot at least once in the process.
Any gun safe capable of being opened quickly by an authorized user would be able to be opened just as quickly by an unauthorized user, aka a child.
I agree with your assertion though, that keeping a gun handy in the presence of an adult is distinctly different from keeping a gun unsecured and not in the possession of an adult. Good point.
My phone has a 4-digit pin code. While not super secure, I'm able to unlock it in anywhere from <1s to 2-3s, depending on if my fingers are cold and if I'm distracted. At worst, it might take me 7-8sec if I'm high stress (I think that's about how long it took me to unlock my phone after I had a wreck, and that was with my arms shaking so badly from adrenaline that I couldn't hold the phone to my ear). On a gun safe, that'd still give me a lot of time to open the door, grab my gun, load it, and find a safe place to hide.
Now, 4 digit pins aren't super secure, especially if there's no limit to failed inputs; a kid could probably go through all 9,999 10,000 potential combinations in an afternoon. However, if you increase that to 6 digits, you now have up to999,999 1,000,000 combinations a child has to go through; yet the combination is still easily rememberable and the time to open the safe has probably barely increased.
Edit: forgot about 0000 and 000000 as possible combinations for 4 digit and 6 digit pins.