The problem is that you're dealing with an analogue signal. The gold standard for debouncing because of that is a low-pass filter, which is implementable by a resistor and capacitor, and way more reliable (and responsive) than any software solution.
Can you describe a case in which rejecting a duplicate keypress that arrives within a specified number of milliseconds is ineffective, unreliable, or even suboptimal?
A lowpass filter is an empirical hack, not a gold standard. It has multiple disadvantages; rather than being "responsive," it adds latency to the initial input for no good reason, and it affects both rising and falling edges equally, again for no good reason. It also requires the addition of unnecessary physical components.