A few points on this if y'all don't mind.
Longswords were not particularly more expensive than any other type of sword. Any sword was well within the budget of most people in late medieval Europe, down to a typical peasant or artisan. In fact, if you read Anne Tlusty's Martial Ethic in Early Modern Germany, by the 15th Century owning a sword was actually a
requirement for many people in Central Europe. In the towns, all burgher citizens or partial citizens (down to journeyman level) and in the rural areas, most peasants as well especially those living in market villages or within the territory of a town (
feldmark) were specifically required to own a sword. Tlusty showed records of people being fined for not owning one.
A typical sword (of any kind) in Silesia or Prussia in the 15th Century cost about 20 kreuzer, or very roughly half a mark. That would be expensive but by no means beyond the budget of most commoners, let alone wealthier artisans or peasants. For comparison, a pair of shoes was about 16 kreuzer. What made a sword expensive were mainly things like embellishment such as gilding, fancy scabbards or artistic scrollwork etc. Cutlers in late medieval Europe were extremely efficient in production of high quality swords of all types.
For context, weekly wages for a tailor in Strasbourg in 1460 was 144 pfennig or 36 kreuzer. Weekly wages for a carpenter in Silesia in 1454 were 24 Prague groschen which is about 18 kreuzer*. A master mason in Prague in 1450 could earn between 18-35 groschen per week. Peasants in Poland could earn up to 30 zloty (equivalent to a florin) annually above and beyond their rents in a good year. A hand-gunner or halberdier in the 1470's could make as much as 3 florins per month.
It's true that longswords were only used for a fixed period, but that period was longer than most would probably guess. Fencing masters continued to train students in the use of the longsword or greatsword into the 18th Century. You see people carrying them (in some form or another) from the late 13th Century through the early 17th. Eventually the rapier and saber eclipsed the longsword in popularity, followed later by the smallsword. But the longsword was popular for roughly three centuries.
We do know that training for a longsword took a bit longer than for other weapons. Piermarco Terminiello published a paper a year or two ago in which an Italian fencing master sent a letter charging the city to train citizens, which included rates for training people to use different weapons. The rates for rapier and longsword were roughly twice that for the other weapons (including sword and buckler) and took almost twice as long.
It is also certainly a nuisance to carry a longer sword but that didn't stop people from carrying them either in a civilian or military context (and both in the city, and traveling in the countryside) well into the late 16th Century. The sword of any kind was almost always a sidearm - for cavalry the main weapon was a lance or missile weapon, for the footsoldier, it was a polearm like a glaive, bill or a halberd, or a pike, or a missile weapon like a crossbow or a gun. The nature of all of these weapons however makes a reliable sidearm very important.
Some image links- I won't embed them as some are large.
https://i.pinimg.com/originals/af/6c/4c/af6c4cae281955bd24f05973eb4c4be2.jpg
https://www.thefashioncommentator.com/wp-content/uploads/2015/11/Aged-28-30th-July-1525-in-Innsbruck-at-Laux-Schaller%E2%80%99s-wedding-in-Schwaz-in-August.-The-bonnet-embroidered-with-velvet.-This-is-when-I-began-to-be-fat-and-round.jpeg
https://www.thefashioncommentator.com/wp-content/uploads/2015/11/2-months-On-2nd-May-1522-I-wore-a-thread-caul-for-the-first-time.jpeg
https://i.pinimg.com/474x/66/34/cc/6634ccacce99ac9b19288c26efc9ae93--traditional-books-augsburg.jpg
https://upload.wikimedia.org/wikipedia/commons/4/45/Urs_Graf_Werbung.jpg
https://upload.wikimedia.org/wikipedia/commons/thumb/d/d0/Bad-war.jpg/800px-Bad-war.jpg
From these facts I would conclude that the choice to carry a longsword, an arming sword, a messer, a cut-thrust sword or proto rapier, an arming sword and buckler, a saber, a katzbalger or any other type of sword, had to do with what weapon you were most familiar with and knew how to use.
In my opinion there is no particular specific association with longswords and cavalry, and I fail to see what advantage a longsword confers over an arming sword when fighting an armored opponent. Fighting in harness is mostly a matter of grappling and using the sword as a lever or crowbar. Both weapons can be used with half-swording techniques. The best sword against a (fully) armored opponent would probably be an estoc or kanzer or some other specific armor piercing weapon.
We can see clearly there are some disadvantages to carrying a longsword. They are buklier to carry, harder to learn to use. I would say also a bit less effective in defense than a sword and buckler. And yet, burghers in towns, knights, Swiss reislauffer, Bohemian heretics and many others carried these weapons on their hips. Defining what precisely what the advantage actually
was really is hard to pin down.
As a fencer, I do think the buckler is a bit more defensively balanced. The reach issue is hard to define precisely, others have pointed out an arming sword or cut thrust sword isn't necessarily shorter in reach. The longsword has a bit more authority and versatility in a bind. I would also say that a longsword allows you to parry or bind from further out, it lets you fight at a greater distance while still retaining some control, and that can matter (it can help) when faced with longer weapons. It also gives you a little bit of an edge against shorter ones. I would still say you are at a disadvantage against a spear but with a longsword you can compensate for that better than with some other weapons.
Having fenced for about 20 years, mostly with longsword but also with rapier and dagger, sword and buckler, messer and saber, including fighting in 10 or 11 full contact tournaments, I have some idea what the different weapons feel like. But I have never killed a man with a sword, fought a duel, or fought in a war (I'm very glad to say) so I can't claim to have real insight into what carrying and using a sword meant for people in the 1450's or 1550's. I can guess though, and my guess would be the advantage of the longsword comes down to one thing - versatility.
It can give you perhaps some more hope of success or survival when faced with someone carrying a staff or a polearm. Against an opponent with a rapier you might be about even but you'd need to have some experience against it. Against a saber, arming sword or shorter weapons like messers or daggers you should have an edge at least initially. And if you are very experienced, you can use a longsword close-in as well as far away.
But you have to be good to protect yourself with it. If I had a time machine taking me to 500 years in the past and had to decide what weapon to bring with me, I'd have to think long and hard about it. A sword and buckler does have some advantages, as does a rapier, as does a saber. Whether to use a longsword, in my mind, would depend on my confidence with that weapon. I think if faced with an opponent using most longer weapons, I would at least have a chance with a longsword, and against many shorter weapons maybe a bit more of a chance to maintain the vor or initiative in the fight - if I fought well, maintained my distance and kept my cool. Big ifs. I can protect my hands with the cross pretty well now with a longsword, and I know how to parry with it, how to bind on an opponents weapon and perform absetzen and versezten. I'm confident I can do that in casual sparring. But in a real fight it always comes down to your state of mind.
Ultimately, the tool only makes so much of a difference. To paraphrase Full Metal Jacket, it's the hard heart that kills.
J
* All these wages are from Uzbrojenie w Polsce sredniowiecznej ("Armaments in Medieval Poland") 1450-1500" A.Nowakowski Polska Akademia Nauk, Instytut Historii Kultury Materialnej, (1990), page 471. Prices are from the same source and from The Hansa, History and Culture Johannes Schildhauer, Dorset Press, (1988), ISBN 0-88029-182-6, page 165
EDITED for clarity. Bullet points didn't work in the first part, and some of the last part didn't completely make sense originally.