In this paper we discuss the Euler-Heisenberg effective Lagrangian in nonperturbative and inhomogeneous field configurations characterized by a strong magnetic field of the form B, = B, = 0, B, = B(x, y). Our treatment exploits some interesting properties of the second-order Dirac Hamiltonian describing the electronic motion in the transverse plane (I, y). In particular, we take advantage of the existence of an energy gap separating the excited states from the lowest-lying modes. The latter are exactly calculable and give the leading nontrivial contribution to the effective Lagrangian. Our results show that the presence of gradients can be accounted for by introducing an effective magnetic field strength defined as the sum of the square moduli of the ground state wave functions. This surprisingly simple conclusion is mainly due to a quantum-mechanical supersymmetry of the problem, that of the second-order Dirac Hamiltonian in the transverse plane (x, y). We recall that the same supersymmetry plays an important role for the spontaneous mass generation in the Nambu-Jona-Lasinio model interacting with an external magnetic field. As a simple application of our effective Lagrangian, we discuss the asymptotic behavior of the dielectric permeability tensor of the vacuum as a function of the external field configuration. No anomalous enhancement of the effective electromagnetic coupling is observed. Implications of this result for the GSI peaks are briefly considered.PACS number(s): 11.15.Tk, 12.20.D~