Is there a straightforward way to get mismatches/indels in a BAM file using pysam?
You're looking for pileup, which is the htslib (and thus samtools/bcftools) method for finding variants. See this section of the pysam documentation. You may want to peruse about the output as well. The gist is:
import pysam
samfile = pysam.AlignmentFile(&quot;ex1.bam&quot;, &quot;rb&quot; )
for pileupcolumn in samfile.pileup(&quot;chr1&quot;, 100, 120):
    for pileupread in pileupcolumn.pileups:
        if not pileupread.is_del and not pileupread.is_refskip:
            # query position is None if is_del or is_refskip is set.
            ...handle mismatches...