When using logstash to consume binary data, some bytes are replaced with ef bf bd

That tells the codec on the input to translate the data from BINARY to UTF-8. The code always outputs UTF-8 because that was all the filters in the pipeline expect.

The ED BD BD is the UTF-8 encoding of the replacement character uFFFD. See also this thread.

Perhaps try the ASCII-8BIT encoding?