No, there isn't. If you do manage to find some work around, don't expect it to continue to work in future versions (or past versions). The supported way to do this is the SECURE flag. Which blocks both, because the idea is that you have data that shouldn't be saved to disk. You mention AccessibilityService- you will not be allowed on the play store if you use that- only actual accessibility apps are allowed to use it, and blocking recording is not an accessibility usecase (if anything it could be argued to be the opposite, as you would possibly break screen readers or other methods).
I honestly question your need for this functionality, other than that some PM or designer thought it would be cool. If you want to block recording, you want to block screenshots as well. Otherwise they can just take a screenshot every 1/30th of a second and have a movie (or use a second device filming the screen). What functionality does it add to block one but not the other?