Thanks for the reply. I actually tried to use this but ran into a dead end, because there’s no way to tell add_filter() to dynamically apply.
The solution I came up with is using add_post_meta() on the pages I want to be disabled for guests, since this function has a page ID parameter.
And then, in the add_filter() function I checked for the value of the meta tag to determine whether the page is visible.