Add a KeyDirectory option to override location of $datadir/keys, and/or a cachedir option to override location of cached files.
It is at least mildly naughty how Tor currently uses the same DataDirectory for both persistent secret things (keys), persistent sensitive things (the state file), runtime stuff (the lock file), and cached objects (cached-*). Perhaps we should provide options to split these up?
This might help a bit with memory usage on platforms where /var is a tmpfs. In legacy/trac#7176 (moved), there was an openwrt patch that changed the key directory to a hardcoded path, but that's obviously not mergeable in mainline tor.