Finding curves on general spaces through quantitative topology, with applications to Sobolev and Poincaré inequalities