Currently, the only way to concatenate an integer to a bytes object is by converting
the integer to bytes with a function call before concatenating. And there is no way to
make a mutable bytes object without a function call. And bytearray function calls are 9-10x slower than b-strings.
I propose an array-type string like the, or for the bytearray. It would work as a
mutable b-string, as
foo = a"\x00\x01\x02abcÿ" # a-string, a mutable bytes object.
foo[0] = 123 # Item assignment
foo+= 255 # Works the same as bytesvariable+=b"ÿ"
foo+= a"\x255\x00" # Concatenation with itself
foo+= b"\x255\x00" # Cross compatibility with bytes objects.
This would be processed the same as, or would be the bytearray,
>>> type(a"\x00\x01\x02abcÿ")
<class 'bytearray'>