\makeatletter
\def\Pnewcommand{\@star@or@long\Pnew@command}
\def\Pnew@command#1{%
\expandafter\@testopt\expandafter{%
\expandafter\@newcommand\csname\prefix#1\endcsname}0}
\makeatother
\def\prefix{my}
\Pnewcommand{macro}[1][!]{\message{Argument is #1}}
\Pnewcommand*{macrotwo}[1]{\message{Argument is #1}}
\mymacro
\mymacro[1]
\mymacrotwo{X}
\mymacrotwo{\par} % invalid
This hooks directly in the commands linked to \newcommand, thus sparing some expansions and assignments with respect to Martin's answer, which is of course more comprehensible. One can also define a \Prenewcommand:
\makeatletter
\def\Prenewcommand{\@star@or@long\Prenew@command}
\def\Prenew@command#1{%
\begingroup \escapechar\m@ne
\xdef\@gtempa{{\expandafter\string\csname\prefix#1\endcsname}}%
\endgroup
\expandafter\@ifundefined\@gtempa
{\@latex@error{\expandafter\noexpand\csname\prefix#1\endcsname undefined}\@ehc}%
\relax
\let\@ifdefinable\@rc@ifdefinable
\Pnew@command{#1}}
\makeatother
It's a more or less straightforward rewriting of \renewcommand and \renew@command. For \newenvironment we can say
\newcommand{\Pnewenvironment}[1]{\newenvironment{\prefix#1}}
and so \Pnewenvironment{env}{start}{end} would define the environment myenv, if \prefix expands to \my.