a)Are climb gradient requirements for aircraft certification or requirements that an operator should comply? or both?
JAR/FAR 25.111 (or EU-OPS version)
"...The take-off and take-off flight path REGULATORY definitions...." They are regulatory for Aircraft certification. BUT, regarding the airline, when those certification criteria can not be met, the airline is required to publish a proven alternative stratagy (Ie; EOSID).
Where these numbers (2.4%, 2.7%, 3.0%, …) came from? : Are these empirical numbers or just as a consensus or decision made by certain aviation authorities or administrations (like FAA, ICAO,…)?
Just to make it clear: for example why the climb gradient for the second segment is 2.4% and not 1.2% (twin) or for example why the second segment is usually the most limiting than the third or the fourth?
Empirical? I suppose so, as they have been proved to work from time to time. However, it would be more appropriate to call them a "Decision" as they are based on regulatory requirements and determined by those agencies, with additional margins for various reasons.
c) If a turn is required after engine failure during takeoff, does this affect aircraft performance?
During a turn the aircraft is not only subjected to its weight, but also to a horizontal acceleration force. The resulting force is called "apparent weight" and its magnitude is equal to the load factor times the weight.
In short, yes it effects performance, which is why the turn is limited to 15 degrees (or another stipulated bank angle). See AMC OPS 1.495 and JAR-OPS 1.495 (or EU-OPS version)
Note that the FAA does not consider this extra vertical margin.
Does that help?