This originally came up as part of https://gerrit.wikimedia.org/r/#/c/384930/ but after discussing it with Tim it can be implemented outside of firejail.
Currently MW has wfTempDir() that in a default configuration is most likely to return /tmp. Due to security problems ([1]) with a world-writable /tmp dir, Tim suggested that we should create a MW-specific dir, such as /tmp/mediawiki-{wikiid}-{randomstring}. And we can make sure the permissions on that directory are not set to be world-writable. wfTempDir() would create that directory on-demand for the request with the correct permissions when the function is first invoked.