Here's an old blog post that explores that topic at least with one specific example: https://www.loper-os.org/?p=861
The gist is that keyboards are optimized for ease of use but that there could be other designs which would be harder to learn but might be more efficient.