restore_current_blog required after switch_to_blog, if I use that in a function?

switch_to_blog changes values of global variables (as you can see here: https://core.trac.wordpress.org/browser/tags/5.0.3/src/wp-includes/ms-blogs.php#L801). It doesn’t matter if you call it in function or not – these variables will get changed.

So yes – you always have to call restore_current_blog when you’ve done all you wanted with the switched blog.

Otherwise these variables will stay changed (so wpdb will query wrong tables and so on)