Where to define common functions for use from inline?

You can write a plain ol’ Python module and install it—it should then be importable by any Python code, including inline snippets.