While filling in a job application, you often have an option “contact the referees after the interview”. Don’t be scared to use it, most of the prospective employers only contact the referees after the interview. If you were shortlisted for an interview, you already have good chances to get the job. After the interview the potential employers tend to rely more on a good in person experience, than on a reference from an unknown person with a potential conflict of interests. Just be honest why you don’t want to ask for a reference from your previous supervisor or PI.
Case 1 – PhD student
A bad reference is always a problem, but if you didn’t get along with your PhD supervisor, it is not the end of the world and your nascent career. I know a PhD student (not his real name), who had a huge row with his supervisor at the end of his postgraduate studies. It was something to do with the authors order on a paper, but the details are not important. What is important, he was able to get a postdoctoral position. After the interview he was asked about the references and told the truth, without getting into the details – that the supervisor is not happy with him, but it is possible to give references from his second supervisor and his Master Project advisor. The interviewing PI was happy to accept his explanation and alternative references. The former student got the job.