I'll assume that trivially abused technologies such as hammers or chain weapons with rocket engines and shaped charge impact weapons are also banned. Same with chemical and biological weapons.
There also some important parameters unspecified in the question. Is it socially and legally acceptable to carry visible lethal weapons? Is duelling legal? Really, this is three questions: Optimal visible weapon to carry for self-defense AND duels. Optimal hidden self-defense weapon. And optimal formal duelling weapon. Of these the last two could really be anything depending on the legal and social parameters so I'll assume you are not interested in those.
For the first, I'd go with a sword. Swords have a tradition value that just cannot be beaten. And for a good reason. Unlike a gun that can be used for lethal damage or threatening with lethal damage, a sword can attack OR defend well, and even gives a degree of control over the damage you cause.
What kind of sword? Well, one reason "a sword" is an easy answer is because there is a sword for every need waiting for you in the history books. Some parameters: Is use of body armor allowed? Do the restriction s apply to actual wars or just peacetime use? From the question I am guessing you expect the restrictions apply during wars (unrealistic IMHO). That would imply needing a sword with reasonable armor penetration. A society like this would probably use augmented or powered armor. (Augmented = takes care of the weight of the armor, no power source strictly necessary; Powered = adds power source for enhanced strength and speed) With modern materials either could be essentially immune to small arms level damage. Explaining why the ban has a chance?
With those parameters a fast precise thrusting weapon with armor piercing point would seem optimal. That is generally called a rapier. With powered armor the rapier would probably be shorter and heavier. The weapon would be of modern alloys, corrosion resistant and almost impossible to break or bend. The tip, possibly the entire blade, would have hardened surface of something like diamond, sapphire, or silicon carbide, whatever is most convenient. There is no real point in giving the weapon enhancements for penetration as it is easier to improve thrusting strength mechanically at the armor. Even a light weight peace time street armor would have more space for enhancements than the blade does and give all the benefits of a heavy swung weapon but with better speed and precision.
It might make sense to give the blade an incapacitating attack after penetrating armor. Either an electric shock or a chemical injection of something like capsaicin would be simple enough to do, fair enough to be allowed, and quite effective at ending the fight. Which otherwise would be an issue with a weapon that is essentially an armor piercing point with some range. A hand-guard would be present obviously.
For off-hand I'd go with a shorter version of the same blade injecting less instant but longer lasting tranquillizers into opponents that you have temporarily incapacitated with the longer blade. Would also give more flexibility to melee range and be useful for parrying. As an alternate weapon maybe some sort of simple chain weapon for entangling the opponent?
And I suppose this would scale to "mecha" on battlefield, tanks and such being of limited use without cannon. The blades would be driven by high speed hydraulics and inject binary explosives. And the mecha might have four or six legs, probably with wheeled drive available.
The biggest change would be that without missile weapons, or some equivalent that would be equivalently banned, aircraft would be unstoppable. Troops could be rapidly and easily dropped anywhere in range, kept supplied, reinforced, and extracted. Ground warfare would be dominated by relatively light easily airlifted elite units adept at hit-and-run and rapid responses to hit-and-run. Such units would be based on the same the heavily defended bases as the aircraft that transport and supply them. Defenses would include "siege units", larger, heavier versions of the light units as well as static defenses. Similar defenses would be present at other strategic locations.