Let $\mathbf{x} \sim \mathcal{N}(\mathbf{m},\mathbf{C})$ and let $\mathbf{D}$ be a diagonal matrix with positive entries and of the same dimension as $\mathbf{C}$. Let $f(z)$ be a strictly increasing and concave function in $z$.
Considering all the possible unitary matrices $\mathbf{U}$ (i.e., $\mathbf{U} \mathbf{U}^{\mathrm{T}}=\mathbf{I}$), I suspect the following holds:
\begin{align} \mathrm{argmax}_{\mathbf{U}} \mathbb{E}_{\mathbf{x}} \big[ f \big( \mathbf{x}^{\mathrm{T}} \mathbf{U} \mathbf{D} \mathbf{U}^{\mathrm{T}} \mathbf{x} \big) \big] = \mathrm{argmax}_{\mathbf{U}} f \big( \mathbb{E}_{\mathbf{x}} \big[ \mathbf{x}^{\mathrm{T}} \mathbf{U} \mathbf{D} \mathbf{U}^{\mathrm{T}} \mathbf{x} \big] \big). \end{align}
However, I don't know how to prove it formally.
My intuition is that, by optimizing over unitary matrices $\mathbf{U}$, we are just playing with the "directions" (note that $\mathbf{U} \mathbf{D} \mathbf{U}^{\mathrm{T}}$ can be seen as the eigendecomposition of a symmetric and positive definite matrix), and I suspect that the directions that maximize $\mathbb{E}_{\mathbf{x}} \big[ f \big( \mathbf{x}^{\mathrm{T}} \mathbf{U} \mathbf{D} \mathbf{U}^{\mathrm{T}} \mathbf{x} \big) \big]$ should be the ones maximizing $\mathbb{E}_{\mathbf{x}} \big[ \mathbf{x}^{\mathrm{T}} \mathbf{U} \mathbf{D} \mathbf{U}^{\mathrm{T}} \mathbf{x} \big]$. It would be great if someone could confirm this.
Note: to make things easier, we can consider $f(z) = \log(z)$ (which is strictly increasing and concave).
I derived the following "partial" result, though still far from answering your question.
If $\mathbf{x} \sim \mathcal{N}(\mathbf{m},\mathbf{C})$, and $\mathbf{D}$ is a diagonal matrix, then given an unitary matrix $\mathbf{U}$, we have
$\mathbb{E}_{\mathbf{x}} \big[ \mathbf{x}^{\mathrm{T}} \mathbf{U} \mathbf{D} \mathbf{U}^{\mathrm{T}} \mathbf{x} \big]=\sum\limits_{i,j}(c_{ii}+m_i^2)\cdot u_{ij}^2 \cdot d_j$
where $c_{ii}$ are the $i$th diagonal element of $\mathbf{C}$,
$m_i$ is the $i$th element of $\mathbf{m}$,
$u_{ij}$ be the element of $i$th row, $j$th column element of $\mathbf{U}$,
and $d_{j}$ be the $j$th diagonal element of $\mathbf{D}$.
Proof:
Note $\mathbf{U} \mathbf{D} \mathbf{U}^{\mathrm{T}}$ is also a diagonal matrix.
the $i$th diagonal element of $\mathbf{U} \mathbf{D} \mathbf{U}^{\mathrm{T}}$ is $\sum_{j}u_{ij}^2\cdot d_j$
So $\mathbf{x}^{\mathrm{T}} \mathbf{U} \mathbf{D} \mathbf{U}^{\mathrm{T}} \mathbf{x}=\sum_{i}x_{i}^2 \cdot \sum_{j}u_{ij}^2 \cdot d_j$
Since $\mathbb{E}_{\mathbf{x}} \big[x_i^2 \big]=c_{ii}+m_i^2$,
$\mathbb{E}_{\mathbf{x}} \big[ \mathbf{x}^{\mathrm{T}} \mathbf{U} \mathbf{D} \mathbf{U}^{\mathrm{T}} \mathbf{x} \big]=\sum_{i}\mathbb{E}_{\mathbf{x}} \big[x_{i}^2 \big] \cdot \sum_{j}u_{ij}^2 \cdot d_j=\sum\limits_{i,j}(c_{ii}+m_i^2)\cdot u_{ij}^2 \cdot d_j$
From here we can find some optimal solution $\mathbf{U}^\star=\mathrm{argmax}_{\mathbf{U}} \mathbb{E}_{\mathbf{x}} \big[ \mathbf{x}^{\mathrm{T}} \mathbf{U} \mathbf{D} \mathbf{U}^{\mathrm{T}} \mathbf{x} \big]$