Those weren't really problematic. I have a D rated Python miner with fixed beams and turret burst. Anything up to Viper / Cobra I tackled with that. No the problematic stuff was higher up, like FdL and such. I ran into a Clipper that wouldn't really take hull damage. I had to ram it with my FAS to kill it. There were several such random encounters.
Okay, truce! I will take off my troll hat and put on my friendly helper hat. Just this once tho, wouldn't want the other trolls thinking I had gone soft, they would probably b@#$er me while I was asleep under my bridge!
Anyhoo, I nearly got killed by an npc a few days ago. I was in my explorer/miner AspX, coming back from a long journey in the void, where I had found a ton of nice raw mats and lots of discovery data. Because all my ships are duel purpose, it can get a bit tight on the AspX with all that mining and exploring kit, so I only have 3A shields + 3 A-rated shield boosters. No weapons, that's just gonna reduce my jump range and slow me down if I have to run. Apart from the G4 FSD (now G5 'coz I found lots of arsenic out there on a distant planet), my shields and shield boosters are minimally engineered. Likewise my engines. My hull is engineered lightweight alloy, can't remember if it's G3 or G4.....
So I'm on the way home and I find a gas giant with a metal rich ring and I scan it and find a platinum hotspot. I have never mined metals before so I think "why the hell not!", get 64 tons of platinum, plus another 8 in the refinery and head home. I get jumped by a pirate on the way home, and it's in my home system, so I don't have another system ready to jump to, so I low wake, but I am mass locked, so going nowhere fast, and my shields are going down at an alarming rate...... I barely got home alive!
After that experience I went back to see that boozer, Didi Vatermann, and upgraded my shields and shield boosters a bit more, then went to see Auntie Felicity to get my engines upgraded a bit more too. So next time I should be able to escape the pirate without taking so much damage.
So, I am thinking on your mining python, A-rate your shield, shield boosters, and your engine. Don't bother with weapons, at least 2 of your hard points are gonna be filled with mining tools so you're gonna be at a disadvantage in a fight, so running is your best option. Engineer your shield, shield boosters and engine so you can run from those pirates and not take much damage. In a python, even minimal engineering will mean you can run from those thieving scum and not take much damage.
Now if you want to stand and trade with a pirate, don't do it in a mining ship. With 2 hardpoints dedicated to mining, you won't have enough weapons to do much damage unless those weapons are heavily engineered. A dedicated combat ship or heavily armed trader/mission runner is better for that sort of thing, and even minimally engineered you then have a fighting chance!
