Once a user length is defined, it is fixed in physical units until reset by the user (see Defining a Length that Scales with Fontsize Changes). So the way you define a "length" that can adjust with page dimension changes is to define it as a macro \def in terms of the system lengths that are updated with format changes, rather than as a \setlength which will fix the length. In this manner, the \def is re-evaluated to its "current" value at every invocation.
Once that lesson is learned, the next aspect to your question is that \linewidth rather than \textwidth is the appropriate length to use when, for example, changing into landscape mode, etc. On page 1 of my MWE, it makes no difference which is used, but on page 2, one can see that the \linewidth definition gives the proper result, not the \textwidth result.
And finally, if \reversemarginpar is used, as is done on page 3 of the MWE, then extra provisions must be made
\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{pdflscape}
\usepackage[nopar]{lipsum}
\def\wrongwidewidth{\dimexpr\textwidth+\marginparsep+\marginparwidth}%
\def\rightwidewidth{\dimexpr\linewidth+\marginparsep+\marginparwidth}%
\begin{document}
\lipsum[1]\marginpar{This is a test of a margin par}\vspace{2cm}\par
Doesn't matter\par
\noindent\includegraphics[width=\wrongwidewidth]{test}
Doesn't matter\par
\noindent\includegraphics[width=\rightwidewidth]{test}
\begin{landscape}
\lipsum[2]\marginpar{This is a test of a margin par}\vspace{2cm}\par
Wrong\par
\noindent\includegraphics[width=\wrongwidewidth]{test}
Right\par
\noindent\includegraphics[width=\rightwidewidth]{test}
\end{landscape}
With reverse marginpar, tricks must be done\vspace{2cm}\par\reversemarginpar
\lipsum[1]\marginpar{This is a test of a margin par}\vspace{2cm}\par
Doesn't matter\par
\noindent\makebox[\linewidth][r]{\includegraphics[width=\wrongwidewidth]{test}}
Doesn't matter\par
\noindent\makebox[\linewidth][r]{\includegraphics[width=\rightwidewidth]{test}}
\end{document}



\linewidthis the same as\textwidth. Should that not have been the case? – sudosensei May 18 '14 at 17:55\linewidthand\textwidthare the same in the default configuration, but if you change the page's orientation,\textwidthdoes not change, but\linewidthdoes account for the revised orientation. Also, keep in mind that the\marginparcan be changed from the one side of the page to the other. While the overall width may stay the same, the beginning/ending locations on the paper will change. – Steven B. Segletes May 19 '14 at 02:23figure*environment (from thesidenotespackage) that places figures across the margin and text block. The length I am defining is only a convenience variable, really, so that I can say\includegraphics[width=\widewidth]-\textwidthandlinewidthare the same as outside thefigure*environment. I guess the question is whether this is the right way to define the length, assuming that starting/ending points have ben taken care of. – sudosensei May 19 '14 at 09:30