I'm not a mathematician, so I apologise for any non-rigorous wordings.
In physics, we oftentimes take $\mathbb{R}$ and, as physicists say, we impose periodic boundary conditions $\psi(\phi)=\psi(\phi+2\pi)$ for any complex function $\psi$ (the wavefunction), we say that we are now working on $S_1$.
A famous example is the Aharonov Bohm effect, when we work on $S_1$ but there is a magnetic flux going through the center of the circle, but not penetrating $S_1$. Upon transporting the particle on the circle from $0$ to $2\pi$, the wavefunction picks up a phase factor $e^{i\phi}$, which is the Aharonov-Bohm phase. Not only that, but recent research on (effectively) imaginary fields gives a phase factor $e^{\phi}$, where in both cases $\phi\in\mathbb{R}$. So, from now on we consider $\phi\in\mathbb{C}$.
It should be stated that the wavefunction is always defined up to a phase in quantum physics, so $e^{ir}\psi\in[\psi]$ for any non-singular $r$. My problem with this is that the resulting wavefunction which going from $0$ to $2\pi \in[0]$ is $e^{i\phi}\psi(0)$, $\phi\in\mathbb{C}$, so it cannot satisfy $\psi(2\pi)=\psi(0)$ unless $\phi=2\pi n,\ n\in\mathbb{Z}$. The case $n\in\mathbb{Z}$ is not always true in pactice since the Aharonov-Bohm effect is measurable while $n\in\mathbb{Z}$ would make it not so.
Hence, I suspect that in such cases, the boundary conditions must not be strictly periodic, but allow for some freedom to accommodate the equivalence classes of $\psi$. So, I expect the boundary conditions should be relaxed to $\psi(2\pi)=e^{ir}\psi(0)$ for arbitrary non-singular $r$. Is my intuition correct?
If so, when we want to take the real space and restrict it to a periodic regime, what are the general considerations for imposing boundary conditions? Are the boundary conditions specific to each quantity we are working with? For example, if we have sets of matrices with equivalent classes defined as those with matrices connected via unitary transformations, should the boundary conditions reflect this in the sense that the boundary condition should be $A(2\pi)=U^\dagger A(0) U$, if the matrix $A(2\pi)$ lies in the equivalence class that $A(0)$ belongs to?