new answer: read -r var
-r raw input - disables interpretion of backslash escapes and line-continuation in the read data and to display:
printf "%s" "$var" echo "$var" should work.
So for your foo function:
function foo { read -r var echo -E "var is : ${var}" } $ foo \\here\is\some\path var is : \\here\is\some\path old answer below (not answering, but maybe usefull ^^)
just replace each \ by \\ to tell the shell "that it a literall \ I want". otherwise (for example in zsh, in your example) it could well be that \b means "1 backspace", or whatever.
you could for example use sed:
sed -e 's,\\,\\\\,g' < the_original > the_escaped_backslaches_version (see how you also need to escape "" there, to tell sed the same thing: "it is a literall "" I want) (and notice I surround it by ' ' and not " " to avoid the shell to interpret most of it too)