I've found myself thinking about the way PDE is often taught, especially when doing finite-domain problems and separation of variables. Typically when considering e.g. the heat equation with non-periodic boundary conditions the interval is of the form $[0,l]$. With Dirichlet boundary conditions, the resulting Fourier functions are $\sin\left(\frac{n\pi x}{l}\right)$; with Neumann conditions, the resulting Fourier functions are $\cos\left(\frac{n\pi x}{l}\right)$. From this the solution can be built by the usual techniques. Part of the utility of doing it this way is making the connection to the periodic Fourier series simple, but I do not think that is a great justification at the expense of weaker understanding.
This, in my opinion, creates mistaken understanding about how these boundary conditions will affect the study of e.g. the heat equation on $[-l,l]$ (or $[a,b]$ more generally), especially when this case is predominantly studied with periodic boundary conditions. With Dirichlet boundary conditions on $[-l,l]$, the resulting Fourier functions are $\sin\left(\frac{n\pi x}{l}\right)$ and $\cos\left(\frac{(n\pi + \frac{\pi}{2})\pi x}{l}\right)$. Similarly for Neumann boundary conditions. This mixture is definitely less ideal than periodic conditions as it cannot succinctly be written as a complex exponential. However orthogonality is retained and (at least from cursory checking) so is completeness. (Completeness should follow abstractly from the spectral analysis of $-\frac{d^2}{dx^2}$ subject to certain boundary conditions but I'm a bit lazy to go through that level of detail haha.)
What other reasons would we restrict Dirichlet and Neumann conditions to $[0,l]$ rather than $[-l,l]$? The periodic Fourier series have the benefit of being succinctly represented by complex exponentials, but that doesn't seem like enough justification. Are there convergence properties (e.g. pointwise, uniform, etc.) of the periodic Fourier expansions on $[-l,l]$ that are missing from the non-periodic case?
I considered asking this over at Mathematics Educators, but figured this community would be better suited.
All finite closed intervals are equivalent by a linear change of variables. The advantage of $[0,l]$ over $[-l,l]$? You said it yourself: for Dirichlet boundary conditions, one formula $\sin(n \pi x/l)$ is simpler than two formulas $\sin(n \pi x/l)$ and $\cos((n+1/2)\pi x/l)$. Of course you could combine them as $\sin(m \pi (x+l)/(2l))$, but that's still slightly more complicated than $\sin(n \pi x/l)$.