How to fix the «Invalid template file» / «require_js.phtml» failure for Magento 2.2.x in Windows?

See also: How to fix the «Invalid template file» / «require_js.phtml» failure of Magento ≥ 2.3 in Windows?