Ok, thanks for the answers.
So I understood that preventing the operation or access to task manager was not a good idea and risked classifying my game as malware (even if that is not its purpose).
But could simply preventing task manager from closing my program, without preventing the user from using task manager to close other programs besides mine, could be a good solution?
If there is indeed a program other than mine on the user's PC that stops working, takes up too many resources, and the user needs to close it with the task manager because for some reason they cannot do so via the close button (which is a problem I hadn't really thought of), then the user will still be able to close it, and the use of the task manager is not blocked, so I think it should be fine and that itch should not block my game and that the antivirus should leave my program alone (well, I hope so).