It should be possible to define a custom initial size for the backing array of ByteArrayOutput, like the jdk impl. The initial size of 32B is tiny and results in dozens of reallocation+memcopies in the lightning-kmp serialization use case (and probably is similar within bitcoin-kmp). That can't be good for performance, I wonder how setting a reasonable capacity would reduce the test time.