Fast method for calculating the self-consistent electronic structure of random alloys