def METHOD_NAME(request):
    """Always use the bytes type instead of string.
    By default, nanopb renders proto strings as having the C type char* and does
    not include a separate size field, getting the length of the string via
    strlen(). Unfortunately this prevents using strings with embedded nulls,
    which is something the wire format supports.
    Fortunately, string and bytes proto fields are identical on the wire and
    nanopb's bytes representation does have an explicit length, so this function
    changes the types of all string fields to bytes. The generated code will now
    contain pb_bytes_array_t.
    There's no nanopb or proto option to control this behavior. The equivalent
    would be to hand edit all the .proto files :-(.
    Args:
      request: A CodeGeneratorRequest from protoc. The descriptors are modified
        in place.
    """
    for names, message_type in iterate_messages(request):
        for field in message_type.field:
            if field.type == FieldDescriptorProto.TYPE_STRING:
                field.type = FieldDescriptorProto.TYPE_BYTES