...shows that the keyboard latency is actually a significant part of input lag.
Debouncing isn't limited to keyboards this is a concept in electronic switching.
http://www.labbookpages.co.uk/electronics/debounce.html
The method of debouncing (software, hardware or both) as well as the "debounce" window which can be set beyond a certain base limit to an arbitrary value has an impact on latency.
"Gaming" keyboards that tend to push the limit of what is acceptable for debouncing like the first generation Razer ones have had issues with keys registering multiple times for a single press.
Most current keyboards don't use the first "drop" as a keypress and usually count 2-3 drops depending on the switch type, and then also have their window set for key repeat if the key is still pressed which then adds additional latency.
Heck even with "normal" keyboards you can sometimes see this in action while keeping a key pressed you might notice that the repeat typing is sometimes jittery that is usually the debouncing in action.
The reason why mechanical switches can be worse off than membrane is because of how the electrical contact is made.
Benchmarking the time from switch activation to the computer being aware of the input should be doable (i.e. ignoring display latency and most of the software stack), alas no tech reviewers I know of do it. So no easy way for a consumer to compare products. IIRC someone measured the Wooting One to have ~4ms of latency. It does have a switch with adjustable actuation point (not so useful if you get the clicky version, since you cant adjust the tactile bump and click).
Edit: By high actuation point I mean farther from the board, it's usually specified from the start of the key travel, so lower numbers.
The biggest latency is the time it takes for the keyboards own SOC to recognize the press with mechanical keyboards there can also be additional latency for things like debouncing depending on the switch in question.
Overall the best keyboard you can use today is one with a low latency controller and 1000hz polling rate it will be about 2-3 times “faster” than a PS/2 keyboard.