Enhancement of quasiparticle recombination in Ta and Al superconductors by implantation of magnetic and nonmagnetic atoms