The Black Hole Mass Function across Cosmic Time. II. Heavy Seeds and (Super)Massive Black Holes