Differential identities and almost polynomial growth. Star algebras and cocharacters