We study in a nonperturbative fashion the thermodynamics of a unitary Fermi gas over a wide range of temperatures and spin polarizations. To this end, we use the complex Langevin method, a first principles approach for strongly coupled systems. Specifically, we show results for the density equation of state, the magnetization, and the magnetic susceptibility. At zero polarization, our results agree well with state-of-the art results for the density equation of state and with experimental data. At finite polarization and low fugacity, our results are in excellent agreement with the third-order virial expansion. In the fully quantum mechanical regime close to the balanced limit, the critical temperature for superfluidity appears to depend only weakly on the spin polarization.