Is there any convincing sense in which the standard trigonometric basis for
the space $V$ of square-integrable real-valued functions on $[-\pi,\pi]$ is
optimal among all the orthonormal bases?


(If this question strikes you as overly subjective, replace "convincing" by "described in the existing mathematical literature".)


Here's an example of the kind of thing that might be true (but please don't
confuse this concrete question with the deliberately vague question that
I'm really interested in!).


Consider the sequence of functions 
$\frac{1}{\sqrt{2}}$, $\cos t$, $\sin t$, $\cos 2t$, $\sin 2t$, $\dots$.
This is an orthonormal basis for $V$ with respect to the inner product
$\langle f,g \rangle = \frac{1}{\pi} \int\_{-\pi}^{\pi} f(t)g(t) \: dt$.
The functions have respective total variation 0,4,4,8,8,$\dots$.
I wishfully conjecture (on the basis of no evidence whatsoever)
that for any finite set $\{f\_1,\dots,f\_n\}$ of orthonormal elements 
of $V$, the total variation of $f\_i$, summed over $i$ going from 1 to $n$,
is at least $4 \lfloor n^2/4 \rfloor$
(which is the sum of the first $n$ terms of the sequence $0,4,4,8,8,\dots$).
In this sense, the standard Fourier basis is a "least wiggly" basis.



In what ways is the standard Fourier basis optimal?
Here's something similar to what you conjecture. Let's work instead with functions $\mathbb{R} / 2\pi \mathbb{Z} \to \mathbb{C}$; one can do similar things in the real-valued case but I find the complex case simpler to write down. 


Say we want to construct an ONB $f\_0, f\_1, \ldots$ of $L^2(\mathbb{R} / 2\pi \mathbb{Z})$ consisting of smooth functions that minimize $\| f\_n' \|\_2$ at each step. (So in particular, this will minimize $\sum\_{k=0}^n \| f\_k'\|\_2^2$ and other such functionals similar to what you proposed looking at.) Clearly we need $f\_0$ to be constant. Then, expand $f\_1$ as a Fourier series:
$$
f\_1(x) = \sum\_{k\in \mathbb{Z}} a\_k e^{ikx}.
$$
We must have $a\_0 = 0$ for $f\_1$ to be orthogonal to the constant function $f\_0$. To normalize $f\_1$ we need 
$$
\sum\_{k \in \mathbb{Z},\ k \neq 0} |a\_k|^2 = 1
$$ 
(with an appropriate normalization of the norm), and since $f\_1$ is smooth,
$$
\| f\_1' \|\_2^2 = \sum\_{k\neq 0} k^2 |a\_k|^2.
$$
Clearly, to minimize $\| f\_1'\|\_2$ subject to $\|f\_1\|\_2 = 1$, we need $a\_k = 0$ for $|k| \ge 2$, so $f\_1$ is a linear combination of $e^{ix}$ and $e^{-ix}$. We'll next want $f\_2$ to be an orthogonal linear combination of $e^{ix}$ and $e^{-ix}$. At the next step, $f\_3$ will only have nonzero Fourier coefficients for $|k| \le 2$, and minimizing $\| f\_3 \|\_2$ forces $f\_3$ to be a linear combination of $e^{2ix}$ and $e^{-2ix}$.


Continuing in this way we get that each $f\_n$ will be a linear combination of $e^{\lceil n/2 \rceil i x}$ and $e^{- \lceil n/2 \rceil i x}$. We see in particular that $\| f\_n' \|\_2^2 = \lceil n/2 \rceil$ for each $n$ is the best one can do, and is almost uniquely achieved by the exponential basis.


