Change cache_path to use std::string throughout, to fix weird string termination bugs in Python