Flat or percentage? Weapon-specific or global?
How about opposite approach... giving bonus when aiming at a visible unit?
That would eliminate problems mentioned above.
That is probably the ideal solution to this right there. Just give a bonus for being able to see the target. It could be adjustable but im thinking a +50% bonus flat is realistic if its a hardcoded option.
I mean in d20 system its a 50% miss chance to shoot at something you cant see and thats flat. Giving you 1.5x accuracy for a direct shot might sound generous but it should drive the point home about firing blind.
That way modders can change the stats and either list the bonus or just mention in parenthesis (Direct Fire gets a bonus).
In X-Piratez I frequently abuse this tactic with the hunting bow and flaming arrows. Particularly in maps like Scientific Experiments where that structure gets in the way but its generally only 1 floor high and it removes all the trees where it sits. Its only moderate range to fire over it and aside from shooting at my spotter they cant do anything about it.
The argument for an adjustable (in)direct fire bonus gets into smart missiles like blaster launchers which have an accuracy arc every time they move to another waypoint. In vanilla if you shoot a Blaster through a narrow space (between characters) and you dont put a couple waypoints between that zone it might accidentally hit something because it doesnt go exactly where you tell it to.
This way you can turn the accuracy down really low for something like that simulating the shooter having to improvise course corrections in real time as they TV-guide the missile like a maverick/redeemer into territory they weren't able to see when they fired it. Thus if they're able to see the waypoint they're moving the missile to it gets the bonus.
In that case the accuracy could be very low but the direct fire bonus could be +100% or something else high.
Likewise when aliens shoots blasters/DPL at you they hit you if they can see you, but when they're shooting around corners to hit the accuracy will be much lower and they may just miss and send the missile off the map.