Yes, a 5-bit encoding is useful in some cases. Especially, in constrained environments, just think of old gaming hardware (e.g. NES) or data-transfer over network.
When the character set is small, strings could be encoded in a bitstream that packs 5 bits per character rather than 8 bits per character. This results in a reduction of data size.
You are compressing data by using a fixed bit-length encoding. Of course, you are trading "compressed data" against "more processing speed" due to the need to "encode/decode".
Using 5 bits allows the data to have values in the range 0-31 ($00-$1F). You can only represent 32 items. By using paging/modes you can extend the number of supported items.
Think of, e.g. 3 pages with 32 chars + 32 chars + 32 control commands.
As said, this is a fixed bit-length encoding. The follow up topics are variable bit-length encoding, then followed by Huffman encoding (for optimizing the encoding by doing a item frequency/occurrence analysis).