Or better yet, use gzip and inline all images as base64 encoded. The file size is very similar to raw data, and the number of requests with associated http headers is reduced.
That has some major downsides. No caching, so any shared images need to be re-downloaded on every page. And the size of base64 if about 40% larger in my experience.
Request count is really not a big deal with HTTP/2 multiplexing.
Don't do this. Browsers are very optimized for subrequests and especially parsing image data.
By forcing base64, you're eliminating all the caching and using much more CPU power to parse that back into a binary image. You're also making the page load slower as the initial payload is bigger and image data has to be handled in line rather than asynchronously.
Might be a good idea for statically generated pages, or the statically generated parts of pages, but I’d be wary of adding any more load to dynamic pages.
Do any static site generators rewrite image links as data URIs?
Request count is really not a big deal with HTTP/2 multiplexing.