That’s one of the reasons that the first thing I do with a new phone is root it and remove the bloatware.
I am not sure that rooting and removing bloatware would also remove a keyboard installed by the manufacturer. However, that is a good idea for the few who do it. However your solution is one that only about 3% of the Samsung buyers ever do, leaving 97% of the buyers vulnerable to this exploit.
Rooting opens you up to other vulnerabilities now that you have all out super user access. You’re at times more in danger from bogus apps on the Android store.