Worth noting that unlike some of the other sources being discussed, this source of latency is more due to physical constraints than bad engineering or bloated software. Keyboards are limited by the physical travel time & de-bounce of the mechanical switches themselves.
So this is more a tradeoff of using mechanical keyboards at all rather than "gah bloated electron" or whatever.
The other common peripheral, mice, don't have this mechanical constraint. They can even achieve sub-10ms for clicks due to the difference in switch expectations ( https://www.rtings.com/mouse/tests/control/latency )
EDIT: Also 30+ms seems to be quite far off. Cherry MX's specs are around 5ms, and I'm getting 8ms playing around with this tool: http://blog.seethis.link/scan-rate-estimator/