A visit to any painting gallery will easily reveal that the rectangular format it's the preferred one by artists of the last centuries. Square format exists, but it is not widespread. Oval and round paintings exist as well, but they are somehow exceptions to the rule.
The "portrait" and "landscape" orientations probably come from painters parlance. Painted portraits of 1 persons are usually in portrait orientation and landscapes are usually in landscape orientation. Think Monna Lisa or the Supper at Emmaus as just bare examples. Artists seems to have always had a strong preference for some form of "orientation" when painting on canvas even though it would have been quite easy to make a square work. (Paintings on plates are obviously round, and the
tondo itself is not a rare form of "orientation", but certainly is not common). This is seen all over the world: Chinese or Japanese prints, for what I recall, also tend to have a rectangular shape (either portrait or landscape depending on the subject).
Probably painting formats influenced photography formats, although it is much easier to crop a photographic print than a canvas, especially after you painted it

.
So I think it can be said with confidence that when photography reached commercial maturity let's say at the end of the XIX century the LF cameras had a roughly square format but ultimately the final product was normally either a portrait to hang on a wall (probably vertical) or a portrait of several persons, a family group to be hanged on a wall (probably horizontal). Or maybe a landscape (probably horizontal) or architectural work (orientation depending on subject, but normally either landscape or portrait). Portraits though were probably the large part of the photographer's commissioned job, by far. Single portraits (portrait) or group portraits (landscape). Just as it ever was in painting.
If you commission a portrait of yourself to a photographer - as an alternative to the commission to a painter - you expect somehow a result which is related to the painted portrait. The pose, the composition, the attitude of the photographic portraits are not radically different from those of the painted portraits. Photographers inherited the painters "language" and with it they inherited the sense of orientation, although with photography they could have easily chosen any form or shape.
It's possible to make a photographic portrait inside a complex leaf shape paper such as an oak leave, but photographers never really exploited this flexibility they have at hand, probably because they remained "bound" to the painting "language".
Looking at old prints, stamps and paintings one very often see an orientation. The square format in the final product is, if not rare, at least uncommon.
A LF camera cannot be easily tilted sideway and from LF (with its "roughly square" film formats) to MF the idea that the image on film is square and the final product is probably either portrait or landscape was I think quite natural and instinctive in any photographer of the time.
Paper is not sold in square format for a reason! If and when you need a square image, you crop the paper. But normally you would need a rectangular paper (which doesn't rule out some further cropping for compositional reasons).
Oscar Barnack cameras didn't force "orientation" and the need to think in terms of orientation. Orientation was probably in the mind of every photographer since the birth of photography. The small format can be markedly rectangular just because somehow for the first time in photographic history it was very easy to orient the camera without clumsiness.
I think it's also interesting that cinema, even though probably or possibly begun in square format, soon developed into landscape mode, and even panoramic mode, reinforcing IMO the idea that the square format is not favoured by image creators (unless they have a specific compositional reason to prefer the square format).
Fabrizio
EDIT Maybe one of the reasons of the scarce success of the 126 format among advanced amateurs was that in a small camera the square format makes no sense, as it is easy to turn the camera on one side. This could be an indirect "proof" that the photographer normally thinks in terms of "orientation" in any case.