\documentclass[12pt]{minimal}
\newlength{\fred}
\setlength{\fred}{1.3pt plus 2pt minus 3pt}
\parindent=0pt
\makeatletter
\def\stripGlue#1{%
	\strip@pt@glue{#1}
}
\def\strip@pt@glue#1{\expandafter\rem@pt@glue\the#1\@nil}
\begingroup
  \catcode`P=12
  \catcode`T=12
  \lowercase{%
    \def\x{\endgroup
      \def\rem@pt@glue##1.##2PT##3\@nil{%
        ##1\ifnum##2>\z@.##2\fi
      }%
    }%
  }%
\x
\makeatother

\begin{document}
\verb|\setlength{\fred}{1.3pt plus 2pt minus 3pt}|

Original length of \verb|\the\fred|: \the\fred

Stripped: \verb|\stripGlue{\fred}|: \stripGlue{\fred}

\medskip
\setlength{\fred}{1cm plus 2.5mm minus 3.14mm}
\verb|\setlength{\fred}{1cm plus 2.5mm minus 3.14mm}|

Original length of \verb|\the\fred|: \the\fred

Stripped: \verb|\stripGlue{\fred}|: \stripGlue{\fred}

\medskip
\setlength{\fred}{1pt}
\verb|\setlength{\fred}{1pt}|

Original length of \verb|\the\fred|: \the\fred

Stripped: \verb|\stripGlue{\fred}|: \stripGlue{\fred}
\end{document} 