The Erd\H{o}s-Hajnal conjecture says that for every graph H, there exists c>0 such that every H-free graph G has a clique or stable set of size at least 2clog|G| (a graph is ``H-free'' if no induced subgraph is isomorphic to H). The conjecture is known when H is a path with at most four vertices, but remains open for longer paths. For the five-vertex path, Blanco and Buci\'c recently proved a bound of 2c(log|G|)2/3; for longer paths, the best existing bound is 2c(log|G|loglog|G|)1/2. We prove a much stronger result: for any path P, every P-free graph G has a clique or stable set of size at least 2(log|G|)1−o(1). We strengthen this further, weakening the hypothesis that G is P-free by a hypothesis that G does not contain ``many'' copies of P, and strengthening the conclusion, replacing the large clique or stable set outcome with a ``near-polynomial'' version of Nikiforov's theorem.