But did you think about using a perfect hash function and table? Based on my prior research, it seems like they are almost universally faster on small strings than trees and tries due to lower cache miss rates.
This last fact might actually support the current model, as it grows linearly-ish in the size of the instruction, instead of being constant like hash.
It is not part of RISC-V, nor supported by any CPUs outside of that vendors' own.