Perform fewer allocations in summarize_protocol_flags()

According to our profiles, summarize_protocol_flags() does a huge number of allocations -- probably because it parses the same flags over and over.

Probably it would be simplest just to memoize the output.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information