In Linux this is a solved problem by a very simple measure. The gestures (click by tapping, scrolling) are turned off while you type for a short period of time (around 300ms) after each key-press. It works surprisingly well and I've never noticed the trackpad not working when I need it too.
I have -- attempting to play Minecraft on a touchpad, or just multitasking real quick. While not a huge problem, macOS does it better and the simple measure is just that - a simple measure.
That far from solves the problem. Your workflow might never require using the keyboard and trackpad simultaneously, but for the majority of users, this “simple measure” is a never ending source of pain.