To avoid using periodic boundary conditions, you may adopt Dirichlet-Dirichlet (or Neumann-Neumann) boundary conditions in the out-of-plane z-direction, or mixed Dirichlet-Neumann boundary conditions if the 2D system of study is asymmetric (no mirror symmetry) in z-direction. In this case, one may avoid an artificial dipole formation due to this asymmetry.