... I'd completely forgotten about unfactioned logic weapons. (I habitually put a factiom module on everything I build, so it just slipped my mind)
Warheads are often slow (default settings don't do much damage), and equally often absurdly damaging to everything around the faction module. (modded settings, to make warheads a viable weapon)
Both are good options. Simple options. I approve.
Or, you can abuse Homebasing and force-docking such that it won't matter that the NPCs declare war.
(takes longer than the unfactioned logic weapon though, and warheads are finicky)
Simply, build a ludicrously over-engined ship, and set up the docker so it forces other ships to dock to it. (none of the NPCs that have docks have faction lockouts)
Then, match speeds with, and force the docking of your target. (this is the hardest part, server lag will screw you rather often)
Once it is docked, return to homebase. (preferably via Jump, but Warpgate or simple slow-boating will work too.)
Then, you dock to your base. (this makes the catcher ship, and the target it caught, become invincible to everything but warheads and torches, which NPCs don't use)
Then, use your torch and burn out the faction module.
Being homebase invincible, you can either simply wait a bit and ask for peace (the further your base from theirs, the easier this is, as the "punishment fleet" takes time to travel), or equip/build some good turrets and start a roight-proppa scrapyard operation.
Heck, you can even have the Homebase abuse force-docking, to force the captured ship to dock to your base, so you can go out and catch another one. (and potentially spark off a lovely war between the NPCs, when their fleets show up and missiles start hitting everything)