function formatPath(path) {
	path = path || 'null';
	if (typeof path === 'object') {
		path = path.id;
	}
	if (path.startsWith('\0')) {
		path = JSON.stringify(path);
	}

	return path;
}
Serialize path to display special characters such as
the null byte of necessary.
@param {string} path
@returns {string}