It'd be clearer if return_read_bytes_and_count and return_written_byte_count_or_error can be combined and separate according to the Ok and Err code path. This is mentioned in #3852 (comment).
(This probably don't need to be an issue, but I am creating this to keep track of what I want to do.)