This is how I might go at it:
%-----------------------------------------------------------------
% Let's create an external text file SomeFile.tex which is to be
% input verbatim:
%-----------------------------------------------------------------
\begin{filecontents*}{SomeFile.tex}
Line 1: abc_def#gh
Line 2: $$$_def#gh
Line 3: %%%_def#gh
\end{verbatim}
Line 7: bla~~~bla
\end{filecontents*}
%-----------------------------------------------------------------
\documentclass{article}
\newcommand\Exchange[2]{#2#1}
\begin{document}
Text
\Exchange{\input{SomeFile.tex}}{\begin{verbatim}}\end{verbatim}
Text
\end{document}

If you don't wish things to be typeset in typewriter-mode and just wish TeX to treat special characters like ordinary characters that shall occur within the text while typesetting as usual, you can try s.th. like this:
%-----------------------------------------------------------------
% Let's create an external text file SomeFile.tex which is to be
% input:
%-----------------------------------------------------------------
\begin{filecontents*}{SomeFile.tex}
Line 1: $&#^_~%\{}
Line 2: $&#^_~%\{}
\end{filecontents*}
%-----------------------------------------------------------------
\documentclass{article}
\makeatletter
@ifdefinable\secondwhentypesetting{\protected\def\secondwhentypesetting#1#2{#2}}
\newcommand\unexpandedwhennottypesetting[1]{\noexpand\unexpandedwhennottypesetting{\unexpanded{#1}}}
\DeclareRobustCommand\myactivateasnospecial{@dblarg@myactivateasnospecial}%
\newcommand@myactivateasnospecial[2][]{%
\begingroup\lccode\~=#2\relax
\lowercase{\endgroup\def~}{\secondwhentypesetting\unexpandedwhennottypesetting{#1}}%
\catcode`#2=13\relax
}%
\makeatother
\DeclareRobustCommand\TypesetFileWithSpecialsAsOrdinaryCharacters[1]{%
\begingroup
% switch special characters %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\let\do=\myactivateasnospecial
\do$%
\do&%
\do#%
\do[\ifmmode\hat{}\else\textasciicircum\fi]^%
\do[\ifmmode_\else\textunderscore\fi]_%
\do[\ifmmode\sim\else\textasciitilde\fi]~%
\do%%
\do[\csname\ifmmode\else text\fi backslash\endcsname]\%
\do{%
\do}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\input{#1}%
\endgroup
}%
\begin{document}
\TypesetFileWithSpecialsAsOrdinaryCharacters{SomeFile.tex}
$$\TypesetFileWithSpecialsAsOrdinaryCharacters{SomeFile.tex}$$
\end{document}

\input{foo_bar#baz})? – Skillmon Oct 26 '22 at 16:30verbatimandshell-escape, if you don't want to use them? I removed them. – dexteritas Oct 26 '22 at 16:30\csname usepackage\endcsname{verbatim}or\input{verbatim.sty}? – user202729 Oct 26 '22 at 17:46