I know a few tricks to get away from Pirating or Hostile NPCs:
Take a Single Bribe for that Faction. Pirate NPCs won't demand anything from you if your rep is +0.5 or Higher with them. So you can fly around freely without needing to worry about NPCs going trigger-happy when they see your Cargo.
When they demand your Cargo, Open another window (Like Chat Window or Rep Sheet) and then close it, the Demand window will disappear so it wont block your view. Then, Get on Cruise (If you're not on Cruise already) and then Engine kill. They'll sit where they are, and after a few secs they'll turn Hostile, but you'll be at a safe distance by then.
If Hostile NPCs attack you, Go on Full Thrust Speed and then Engine-kill and turn to face them. This way, you'll be drifting away from NPCs while looking at them, and it gets the AI a bit messed up, so they'll think you're heading towards them and will sit at where they are. After a few hundred meters you'll be out of their Weapon Range, and you can turn around and start cruise again after they disappear from your Scanner.
This way, you won't need to worry about any Pirate or Hostile NPCs. Although they get annoying from time to time.
---
' Wrote:i wonder what would happen if you hailed a nomad npc? xD
*** tits ... or ... gtfo ***
Never wondered why they wanted President Jacobi so badly?
But in a more serious note:
Sometimes when I hailed NPC's I just hear 10seconds later "you had you chance!" and they turn red ^^
Without ever popping the drop or cancel screen.
I once got a different thing. Got hailed by BHG on my IMG to drop the Hessians. I clicked the "Okay" or whatever it was button and jettisoned it and still they went hostile to me and trying to kill me. :/ Guess the AI got messed up?