If the energy source is handwaved then the electrolaser is a serious contender.
It's a medium distance stun-gun/direct energy weapon, that rely on:
- creating a plasma channel which connects the target with the "muzzle". It uses a powerful laser discharge to ionize the air along the path
- a high-voltage discharge is then created along the plasma channel.
And no, "if you have a powerful laser, why do you need the electricity?" is not an option - powerful lasers overheat with prolonged usage and a 1GW laser pulse that only last 1 nanosecond (example) won't deliver enough energy to knock the target down. But it may (depending on the wavelength) be enough to ionize the air enough to create the electrical discharge channel.
The laser doesn't need to be bulky. For example, a Transversely Excited Atmospheric laser uses just two parallel electrodes (and a good/ultrafast capacitor - the larger the capacitance, the larger the energy in a pulse).
Granted, you may want to add:
- a pressurized lasing cavity - the larger the amount of lasing medium, the larger the energy/power in the pulse. And you can lengthen the electrodes (the "barrel" so to speak) only within some limits, thus better increase the density of the medium.
- a gas recirculation pump - the lasing medium ends in a metastable state in which it stays for some (tens of?) microseconds, making the pulse repetition low. Bringing fresh gas for the next discharge won't only allow it to "recover" its lasing capabilities but will also help cooling it.
- some optics for focusing/collimating the laser - UV transparent glass will be necessary, but they aren't something fancy.
All of this elements as simple enough to qualify for "easy to repair no fancy parts". Plus, using "atmospheric" gases makes it more efficient in ionizing the gasses in the atmosphere.
Now, the electrical part of it (both TEA laser and the attacking discharge) require some pretty high voltages. If you try to use trivially available materials to crank up the voltage, you're pretty guaranteed to end with a thing that's too bulky to be used as a handgun (vehicle mounted weapons are possible within the today's technology).
But if you use "really really honest to God room temperature superconductors" as the thin wires for your coils and some materials with high magnetic saturation for the cores, the electrical part may allow you to obtain something of the "automatic rifle" form. (I doubt the pistol form factor is possible, you still need mechanical strength to overcome the the repulsive forces caused by the magnetic fields in those coils).
Of course, if your "handwavium power source" is already able to deliver high voltages, you are already there, not much except triggering needs to be added.
Yes, it can work with batteries, but:
- raising the voltage will imply efficiency loss and lower firing rate
- the amount of energy you can get from batteries may limit the number of shots you get from them.