Given a finite set $S$ of distinct primes, we propose a method to construct polylogarithmic motivic Chabauty-Kim functions for $\mathbb{P}^1 \setminus \{ 0,1,\infty \}$ using resultants. For a prime $p\not\in S$, the vanishing loci of the images of such functions under the $p$-adic period map contain the solutions of the $S$-unit equation. In the case $\vert S\vert=2$, we explicitly construct a non-trivial motivic Chabauty-Kim function in depth 6 of degree 18, and prove that there do not exist any other Chabauty-Kim functions with smaller depth and degree. The method, inspired by work of Dan-Cohen and the first author, enhances the geometric step algorithm developed by Corwin and Dan-Cohen, providing a more efficient approach., Comment: v2: additional funding information added to the acknowledgements, no other changes