The current implementation of encoding and decoding of binary BSON CStrings takes two passes.
1. When encoding, one pass to encode and a second to verify that the resulting CString has no null bytes
2. When decoding, one pass to find the terminating null byte and a second to decode the UTF8 bytes
Both directions can be sped up by writing a custom UTF8 encoder that uses a single pass.