For some applications, you might want to set the delay and repeat rates, with set_keyboard_rate(delay, repeat). Default is 250, 33 (milliseconds). You might want to set it for high speed and use rest() to slow it down where necesary, to vary the speed as the program may require.
But clear_keybuf() is definitely useful for the problem you mentioned. I use in my text editors to reprevent buffer overload when scrolling.