When doing research for supporting local view in external engines one of the options were to move the local_view check to the depsgraph query T61797: Cycles ignores 'Local View' mode during Prreview. In the end it was not easy to add it in the API in a clean way so I had to find a different solution.
This diff is the implementation that I did so far.