I have not tested it myself, but a search of "loot" in all files shows me the function bool LootCritter(Critter& npc, uint crId, bool lootEx, uint16 hexX, uint16 hexY)
in main_planes.fos
which looks promising.
Edit: If you just replace the code inside the function definition with return false;
it will successfully make guards unable to loot, but the NPC that would have looted you will just become "busy" after walking up to your corpse. Messing around with when the function returns true or false should get you somewhere.