You can exploit the fact that lengths in TeX are always normalized in pt and that l3-fp converts lengths to their value in points as well.
\documentclass{article}
\ExplSyntaxOn
\NewExpandableDocumentCommand{\maxlength}{m}
{
\fp_eval:n { max(#1) } pt
}
\ExplSyntaxOff
\newlength{\testlen}
\begin{document}
\setlength{\testlen}{\maxlength{1pt,2pt,3pt}}
\the\testlen
\maxlength{45pt,0.5\textwidth,20cm}---\the\dimexpr20cm\relax
\maxlength{45pt,3\textwidth,20cm}---\the\dimexpr3\textwidth\relax
\edef\test{\maxlength{600pt,\textwidth,6cm}}
\texttt{\meaning\test}
\end{document}

As usual, for older versions of LaTeX you might need \usepackage{xparse}.
Also, I didn't really find a good result on Google for this general question that I had. So that is why I created this question.
– clel Jun 06 '22 at 18:08