Mankiewicz's theorem and the Mazur--Ulam property for C*-algebras