That follows is a method using the integral formula for the derivative of the $\log$ function: let $f:A\rightarrow \log(A)$ where $A$ has no eigenvalues in $(-\infty,0]$; then (*) $Df_A:H\rightarrow \int_0^1(t(A-I)+I)^{-1}H(t(A-I)+I)^{-1}dt$.
Let $\Lambda=diag(\lambda_i),R=M\Lambda^tM^T,Z=\log(R),\phi:t\rightarrow tr(ZZ^T)=tr(Z^2)$. Clearly $R'(t)=Mdiag(\log(\lambda_i)\lambda_i^t)M^T$.
$1/2\phi'(t)=tr(ZZ')=tr(Z\int_0^1(u(R-I)+I)^{-1}R'(u(R-I)+I)^{-1}du)=\int_0^1tr(Z(u(R-I)+I)^{-1}R'(u(R-I)+I)^{-1})du$.
Remarks. Clearly $\phi,\phi'$ cannot be formally calculated. For a given $t$, the calculation of $\phi(t)$ is relatively fast. The calculation of $\phi'(t)$ (for a given $t$) is not so easy because we are in front of a complicated rational fraction in $u$; then we need some software as Maple to do the job. In particular, Maple directly gives to you the $\log$ of a matrix. Anyway, the calculation of $\phi'(t)$ is slow. Practically, we can proceed as follows:
Draw an approximtion of the curve $x=\phi(t)$ or print a list of values of $\phi(t)$; locate, in $[a,b]$, a possible local extremum.
Use the regula falsi method for solving $\phi'(t)=0$ in $[a,b]$.
That follows is a toy-example: $M=\begin{pmatrix} -32&27& 99\\-74&8&29\\ -4, &69& 44\end{pmatrix},\Lambda=diag(4,16,7)$.
A local minimum is reached in $[a,b]=[-3.847,-3.845]$.
- With one iteration, we obtain $t_0=-3.846234045,1/2\phi'(t_0)\approx -7.10^{-9}$.
With Maple and this toy-example, each calculation of $\phi'(t)$ requires 0"9, with $15$ significant digits.
EDIT. You can see a proof of the above formula (*) in my answer to Calculating the differential of the inverse of matrix exp?