We investigate the 3.45-eV luminescence band of spontaneously formed GaN nanowires on Si(111) by photoluminescence and cathodoluminescence spectroscopy. This band is found to be particularly prominent for samples synthesized at comparatively low temperatures. At the same time, these samples exhibit a peculiar morphology, namely, isolated long nanowires are interspersed within a dense matrix of short ones. Cathodoluminescence intensity maps reveal the 3.45-eV band to originate primarily from the long nanowires. Transmission electron microscopy shows that these long nanowires are either Ga polar and are joined by an inversion domain boundary with their short N-polar neighbors, or exhibit a Ga-polar core surrounded by a N-polar shell with a tubular inversion domain boundary at the core/shell interface. For samples grown at high temperatures, which exhibit a uniform nanowire morphology, the 3.45-eV band is also found to originate from particular nanowires in the ensemble and thus presumably from inversion domain boundaries stemming from the coexistence of Nand Ga-polar nanowires. For several of the investigated samples, the 3.45-eV band splits into a doublet. We demonstrate that the higher-energy component of this doublet arises from the recombination of two-dimensional excitons free to move in the plane of the inversion domain boundary. In contrast, the lower-energy component of the doublet originates from excitons localized in the plane of the inversion domain boundary. We propose that this in-plane localization is due to shallow donors in the vicinity of the inversion domain boundaries.