What do you suggest we do in these specific cases? Do you have an example of another product that does it in a way we can take inspiration from?
You can type `, select it, then type ` or cmd+E to toggle it to inline mark.
You can hit cmd+E and then type `. You can use cmd+E to toggle the code mark for the next character when typing, just the same you can with cmd+B for bold or cmd+I for italic.
The <kbd> input rule auto-selects an empty character (to keep the browser from auto-deleting an empty node), so you just have to deselect it first (because hitting ` in this case makes an inline mark of the selection – we can potentially remove that behavior, though, as we have cmd+E for this).
I understand those may not be ideal, but they are the compromises we have for all the particularities we have within Discourse. We’re open to suggestions, if you can share how you’d like it to work instead.