Plural form of "out of the goodness of his heart"
Solution 1:
The good news is that the use of the singular or plural is not too important - native speakers are often unsure of what should be used and thus unwilling to criticise others.
As a general approach, the singular is used where the group holds the object in common, and the plural is used where each individual member of the group personally has the object.
"Children should not put their (his/her) head out of the window (Each child in the group should not put his/her own head out of the window.)
"The children screamed as the bullets flew over their (all of their) heads." = the bullets went over the heads of all the children at the same time.
In his "Modern English Grammar ..." (1913) Jesperson remarks
Characteristics of Several Individuals
4.31. "We had made up our minds not to make this history public during our joint lives" (Haggard She 3). In such cases, it is usual to employ the plural of a substantive to indicate that each of the persons mentioned had his own mind, his own life, etc.
4.33. With "such words as life and death, the sg and pl often express different ideas: their married life was a singularly happy one (in speaking of a married couple)— their married lives were led under totally different circumstances (in speaking of two brothers).
4.35. In some set phrases the singular is invariably used even with reference to a plural subject. A typical instance is women with child as the plural of a woman with child = 'a pregnant woman' (with child is- an- adjunct and as such invariable), while women with children would mean 'women together with children' or 'mothers of families':