  We present a method that maximises the experimental sensitivity to new
physics contributions in $B^\pm\to\pi^\pm\mu^+\mu^-$ decays. This method relies
on performing an unbinned maximum likelihood fit to both the measured dimuon
$q^2$ distribution of $B^\pm\to\pi^\pm\mu^+\mu^-$ decays, and theory
calculations at spacelike $q^2$, where QCD predictions are most reliable. We
exploit the known analytic properties of the decay amplitude and employ a
dispersion relation to describe the non-local hadronic contributions across
spacelike and timelike $q^2$ regions. The fit stability and the sensitivity to
new physics couplings and new sources of $CP$-violation are studied for current
and future data-taking scenarios, with the LHCb experiment as an example. The
proposed method offers a precise and reliable way to search for new physics in
these decays.
