From a practical point of view, the small window with ventilation in the bathroom can provide better ventilation and help reduce the humidity and odor in the bathroom. However, this kind of window may increase the noise of the toilet, which may affect the user experience in some cases.
Generally speaking, it depends on personal preferences and needs whether small windows are opened in the courtyard walls of rural areas for toilet ventilation. If you are troubled by this, you can consider transforming that window into a door, or using something like a mirror to stop the possible leakage of wealth.