Yellow flags currently serve no purpose but to randomly mitigate the active use of DRS near the end of the race.
Yellow flag situations currently lead to less control of the players to directly dictate the end of the race.
Players who do not routinely maintain their car constantly break down near the end of the race. This is the main reason yellow flags will occur much more at the end of the race when the player's actions are the most pivotal.
Suggestion - Enable a Push Level 6, fastest mode available however there is a risk of crashing and/or the below mentioned suggestions such as an Aggressive mental state. Yellow flags would be directly attributed to a reward/risk of the players utilizing it. Remove yellow flags for cars breaking down or cars running out of fuel. This in turn leads all yellow flags being directly triggered by players actively participating in the race. While there is room for abuse I think this leads to less frustrating circumstances for yellow flags.
Some alternatives to crashing resulting in less player frustration due to a DNF
A) Driver's Mental stance/Attitude (Aggressive, Neutral or Passive).
Aggressive would lead to increased chances of passing/defending but also lead to more incidents with other drivers
Passive would lead to no increased passing/defending chances however ensure your driver rarely if at all initiates collisions and/or errors.
B)Collisions (cumulatively increased by push level or aggressiveness) due to racing incidents in which car damage occurs
C) Driver errors (increased by push level) in which they take a turn wide, are late on the brakes etc resulting in an error
D) Driver errors (increased by push level) with flat spotting the tyres (decreasing their life)
D) Player controlled Engine mode/performance levels excessively pushing this would damage the engine, possibly to the point of exhaustion
Vehicle damage could be implemented, and the player would have the option to enable "Repairs" for pit stops to bring their car back up to optimal performance as a counter balance for sustaining aggressive push levels.