Brilliant paper by Alexander Gross and Björn Brembs, last revised in July:

The affordability problem of scholarly publishing, i.e., the supra-inflationary price increases with stagnating library budgets, has been a hot topic for more than three decades. In recent years, […] the average cost of an article has emerged as a useful measure with which to compare different business models. However, most authors refer to the prices charged by the publisher, not the actual cost to the publisher. One consequence of this mis-attribution is a potential overestimation of the actual costs of scholarly publishing due to the inclusion of the business models and pricing strategies of publishers into the calculation. To close this gap, here we provide a bottom-up calculation of the cost of efforts and services which are required to achieve a certain service level in order to publish an academic journal article.

Gross and Brembs' estimate of cost per article? Something like $200 to $1000, depending on the journal set-up, with the cost for a "representative scholarly article" at about $400. That's roughly a tenth of the commercial publishers' typical APC.