Efficient treatment of the effect of vibrations on electrical, magnetic, and spectroscopic properties