Firstly and most importantly, I like that you're using 'gender' in the politically incorrect way. Bonus points if you manage to trigger someone
It's sometimes possible, but usually not too reliable. Males can often have sloughs which look like females, this is completely normal, and I've had females slough and look fairly similar to males. If you get whopping great sperm plugs you can be fairly sure it's a male but in general checking sloughs isn't a particularly reliable way to sex them. Other than a talented individual probing it (many who claim to be good manage to barely get more than 50% correct), behavioural sexing is the best way. Snakes haven't been told the bullshit that gender is a social construct, so if you have two pythons go into ritual combat acting like males they are males (this rarely if ever works on Diamonds as down south it's too energetically expensive to fight so they just have laid back gang bangs). If they have sex though you can be sure the one acting like a male os male and 99.9% sure the female is female (otherwise you have one clever male allowing his stupid competition too wear himself out, allowing the clever one to have more energy and goo left over to use on the real female. This is not at all a common strategy in pythons (maybe they have sufficient self respect) so you can be sure they're the sexes they're acting like, more sure than methods like probing, popping and slough examination.