The stellar content of the Hamburg/ESO survey. II. A large, homogeneously-selected sample of high latitude carbon stars