This patch exposes the bases of a view layer to Python.
Code example to hide all objects with a name starting with 'C' from the viewport, in the current view_layer:
import bpy
for base in bpy.context.view_layer.bases:
if base.object_name[:1] == 'C':
base.hide_viewport = TrueBases can also be accessed with object name like this: bpy.context.view_layer.bases['Camera'].