Despite strong connections through shared application areas, research efforts on power market optimization (e.g., unit commitment) and power network optimization (e.g., optimal power flow) remain largely independent. A notable illustration of this is the treatment of power generation cost functions, where nonlinear network optimization has largely used polynomial representations and market optimization has adopted piecewise linear encodings. This work combines state-of-the-art results from both lines of research to understand the best mathematical formulations of the nonlinear AC optimal power flow problem with piecewise linear generation cost functions. An extensive numerical analysis of non-convex models, linear approximations, and convex relaxations across fifty-four realistic test cases illustrates that nonlinear optimization methods are surprisingly sensitive to the mathematical formulation of piecewise linear functions. The results indicate that a poor formulation choice can slow down algorithm performance by a factor of ten, increasing the runtime from seconds to minutes. These results provide valuable insights into the best formulations of nonlinear optimal power flow problems with piecewise linear cost functions, a important step towards building a new generation of energy markets that incorporate the nonlinear AC power flow model.