One likely answer is the ‘B’ gene. This gene, also called “precocious yellow”, causes the stem of the squash to be yellow rather than green. Oved Shifriss, a plant breeder with Rutgers University, researched this gene and used it in extensively his breeding program – you can read one of his summaries of this work in the 1987 Cucurbit Genetics Cooperative Report. There are many reasons that this gene is useful in varieties, including:

  • Fruits turn yellow earlier, making them more suitable for baby vegetable markets – and they lack the greenish cast typical of immature fruits
  • The ‘B’ gene may increase the number of female flowers, increasing yields
  • Varieties with the ‘B’ gene do not show symptoms when infected by viruses

There are a couple of downsides associated with the B gene. First, the gene makes the peduncle (the fruit stem) yellow, rather than green. While this could theoretically be a problem in marketing, I suspect that consumers are used to seeing the yellow peduncle by now. See below, the peduncles of Enterprise (which does not have the B gene) are green and the fruit has a greenish color, whereas both stems and fruits of Fortune (which does have the B gene) are a warm yellow. 

Second, the leaves of these varieties may turn bright yellow under certain environmental stresses, most notably cool weather (which we’ve had a lot of in early June, 2020). If you see this discoloration, you will likely note that it’s unique to certain varieties – only those with the B gene. This includes several Cucurbita pepo varieties (summer squashes, and some acorn types like Dr. Shifriss’ Golden Acorn) many Cucurbita maxima (including giant pumpkins and ‘Sunshine’ squash). While alarming, this is nothing to worry about; usually just one or two leaves turn bright yellow, and then once the cold stress disappears, the next leaves emerge with their normal dark green color.

'Enterprise' summer squash; without B gene. Note
green peduncles, and greenish hue of fruit
'Fortune' summer squash, with B gene. Note yellow
peduncles, and golden yellow color of fruit.
Here, you can see that just the leaves at one particular
age turned bright yellow; all the older and newer leaves
are nice healthy dark green.
In this photo of a variety trial, you can see that some varieties (those
with the B gene) are expressing bright yellow leaves, whereas those
without the B gene don't have the bright yellow leaves.
While shocking, the leaf yellowing associated with the B gene is 
usually temporary, and does not pose a problem for the plant!