Note: For brevity, the commands use here-strings (<<<) and ANSI C-quoted strings ($'...'). Both these shell features work in bash, ksh, and zsh.
# GNU Sed
$ sed ':a;$!{N;ba}; s/\n/\t/g' <<<$'line_1\nline_2\nline_3'
line_1 line_2 line_3
# BSD Sed equivalent (multi-line form)
...