STY+CI: check for private function access across modules
The added checks here are broken off from #36055.
nice! Hi @jbrockmendel - I have a question about this check - why only check for function calls?

Specifically, should this (`generic._shared_docs`)

https://github.com/pandas-dev/pandas/blob/e97c7667a648dc2ce5dbe550b117f3c9cac17b43/pandas/io/pickle.py#L14-L19

not count as a private import across modules? > Specifically, should this (generic._shared_docs) not count as a private import across modules?

It should, we just whitelisted it in the code check.  I think we did that out of convenience more than any principled choice, so I'd be fine with changing it.