It is hard coded for GUI purposes, but the slots are still on the cre/chr file.
It
might (I say might because it is only a theory no actual proven knowledge here) be possible to use NI or Shadow Keeper to add weapons to the slots that aren't visible in game to your party members in the save file. For testing purposes, you might want to assign throwing axes, throwing daggers or other items with visually noticeable in game animations. If you see the weapons you assigned get used in combat with a script that equips ranged and/or equips melee, then you know that you can cheat yourself into having a weapon in all four slots. Just remember what you put in the slots unavailable by the GUI. Since some weapon types don't mix (a la two bows), it could be possible to crash the game.
If you wanted to change what was in those slots (after you've proven that the idea will work), you'd have to do it outside of the game again in NI or Shadow Keeper...
The worst that can happen is that the game will crash when you load up the save file with your modified party member so backup the save file before messing with it.
If you choose to try this unproven idea out backup your save files before proceeding.
Can I not stress that enough? Backup your files before messing with them? Apparently not....