Speed up smart_element_or_specie by 30%, which greatly speeds up entire
pymatgen.