You just need to play with “Set Contraint Mode” and “Set Symulate Physics”.
Example:
You manually set the default value either locking the rotation axis or not. In this example, I locked all 3 axis.
So, it will start with no rotations, and if you press L, it will remove the contraints (mode=none) and the mesh will start rotating. Press L again, and the mesh stops rotating (mode=default). And so on.