You are right, variable-length strings are difficult. You could try to pack as many characters as possible in a computer word (or in a big int data type), say
P characters, and then use the PGM-index to find the strings that share a prefix of
P chars with the given query string. I discussed this solution in a GitHub issue (
https://github.com/gvinciguerra/PGM-index/issues/8#issuecomm...).
It may work in practice, but it's far from being adequate if compared to trie data structures (and their recent advancements).