Is there a way of defining a command that can be executed only once and is then redefined to be a no-op?
Related:
Is there a way of defining a command that can be executed only once and is then redefined to be a no-op?
Related:
An easy way is to just nullify the macro within the body so that the next time it does not have an effect if it is called again via either
\global\let\FirstTime\relax%
or
\global\def\FirstTime{}%

As per David Carlisle's comment, we need to add a \global to ensure that the macro is nullified for subsequent use in the case the first use was within a group (as per updated test case below)
\documentclass{article}
\newcommand*{\FirstTime}{%
\gdef\FirstTime{}%
\textbf{FirstTime: }%
}%
\begin{document}
\begingroup
abcd \FirstTime defg \FirstTime xys
\endgroup
abcd \FirstTime defg \FirstTime xys
abcd \FirstTime defg \FirstTime xys
\end{document}