instead of writing a string to a buffer api (in python 3) write a buffer.

Signed-off-by: David Black <dblack@atlassian.com>
_need_compat_layer is not required in python 3.

Signed-off-by: David Black <dblack@atlassian.com>