The idea that I have in mind is quite simple: the player selects a "Peek Keyhole" inventory item, places himself/herself in front of a door and presses the "use" key to peek through. No leaning forward, no accurate positioning. For as long as a door is highlighted, and the player is at a reasonable distance from the door, players can peek through it, just like using lock-picks.
I have yet to decide whether the peek will have an on/off toggle or the peek will be continuously enabled for as long as the player keeps pressing the "use" key. Both options work fine in my prototype but I have yet to examine the pros and cons in detail. Opinions are welcome.
Back to basis, I can think of three mandatory main rules:
The door must have a handle: otherwise you can peek through other items with doors acting as lids, such as chests.
The door mustn't be locked: the reason is that if a door is locked perhaps it isn't the time to know what's behind. Besides, for the peek to work it would seem we must "travel" to other side and we could accidentally trigger a goal before its time. If a door is unlocked nothing is preventing you from passing through therefore you can peek through it pretty safely.
The peek POV must be static: meaning you get to see what's right ahead of the keyhole, in a forward position relative to the position of the keyhole or door. Players cannot use the mouse. Peeking through doors is quiet an advantage already and I think players shouldn't see too much of what's on the other side. Depending on the setup of the door and the area ahead sometimes you will get to see more, sometimes less.
Now, how do we about it?
We can use the built-in "Peek View" (fully or to an extent) or we can create our own implementation. I would like to try all options we can think of and see what works best. I have so far been tinkering with the built-in solution. It works, but there still are some big challenges ahead.
I didn't want to use handles as a reference to avoid any potential clipping and thanks to @Dragofer we can now tell reliably and in in real time the exact center of a door, regardless of its position, orientation or rotation. The center of the door will be the reference point for our peek.