Power spectrum of domain-wall network, and its implications for isotropic and anisotropic cosmic birefringence