\documentclass{article}
\newcommand{\defun}{\tt}
\begin{document}
\section{\defun SomeFunctionName arg1 arg2}
Call {\defun SomeFunctionName} to foo the bar.
\end{document}
\documentclass{article}
\newcommand{\defun}{\tt}
\begin{document}
\section{\defun{SomeFunctionName arg1 arg2}}
Call {\defun{SomeFunctionName}} to foo the bar.
\end{document}