An easy solution, that will not happen due to accountants, is to include a toilet and galley behind the locked cockpit door.
Contrary to popular opinion, most professional pilots don't have time to cook their own food preflight or inflight. And their isn't simply enough space or the ability to retrofit a toilet and a galley in any modern airliners.