You can also use the "plain TeX" method of indexing the actual ascii character in the current font:
\char`\\
\char`\~
I often use the former for writing macros that need the backslash in the typewriter font; \textbackslash will sometimes still use the roman font depending on the font setup. Of course, if you're using these a lot you should define your own macro for them:
\newcommand\SLASH{\char`\\}