What you’re looking for is called “debouncing”. I think the answer I’m linking here is wrong, the time is not tuneable in libinput. If you want to go through the ordeal of re-compiling libinput and shoving it in your system (without breaking it all?), it is
debounce_set_timer() and debounce_set_timer_short() in evdev-debounce.c. I think it’s the ms2us(25) call.