It is a feature of most game engines. Unreal has a standard SetGamePaused function, for example.
But like most things in game development there is no solution that fits every use case.