It is argued that the boundary conditions on a particle in a box (the box being a potential with value $0$ on the interval $[0,L]$ and infinite everywhere else) are $\psi(0) = \psi(L)=0$. Since the particle cannot with any probability be outside the box, the wave function there must be zero, so by continuity that boundary condition holds.

But what if we do not consider an artificially confined interval on $\mathbb{R}$, but instead a Hilbert space that is defined exclusively on $[0,L]$? This is exactly the same problem, except we lack the boundary conditions: since there is no zero wave function outside the box to speak of (because the outside doesn't exist), we cannot argue that the wave function goes to zero on the boundary. My question is therefore: is there another reason that this has to be the case, or is the wave function somehow "free", like a plane wave?

I believe this has practical implications: solving Schrödinger's Equation in spherical coordinates gives us the coordinate $r$ that is defined purely for $r>0$. Solving for a free particle, we find that the radial component is given by the spherical Bessel function $j\_l$. When $l=0$, the wave function does not vanish at the origin. It seems to me we've now "lost" the $r=0$ boundary condition (although we have already obtained a discrete set of eigenstates), and this appears to be no issue. Would it be meaningful to apply this reasoning to both ends of the box? And if so, what does the answer tell us?