Electromagnetic response in strong magnetic fields. General formalism and vacuum polarization for parallel propagation