This is fine. Maybe just unconditionally call iolist_to_binary and add a comment about why.