So this (having other APIs write into the allocated buffer) would be use case where PyBytesWriter_WriteBuffer() would make sense. Fair enough.
I still don’t think that we should make this the default way of accessing the internal bytes buffer and rather provide a safe writer interface. PyBytesWriter_WriteBuffer() could then later also be changed to provide access to a separate buffer which then gets copied into the actual buffer, if we ever want to make changes to the bytes internals.
We have the Unicode writer API, because of the complexities around the internals of the implementation (having three different internal ways of storing the data).
We don’t have such complications with the bytes type at the moment, but we may want to still have more control over the internals to implement optimizations or protections in the future, or where we want to be able to use the writer API for bytes subclasses implementing these.
FWIW: I don’t see much point in having a writer API for bytes at all, if we decide that direct writing to the internal buffer is still deemed the best way to fill a bytes object during its creation. We can just continue the approach we’ve been using for 30+ years without new APIs - perhaps make the resize API public and that’s it.