It'll work fine until the OS kills it to save battery. That might not happen for a long time, since it's designed not to kill apps that are doing useful things and not using tons of power. Still, if it starts consuming too much battery or battery gets low, it might. GMS is pretty well designed, though; you can see in Settings how little power it generally uses.
Either way, you're not saving battery, really. If you keep getting notifications, then its not being optimized, and it's consuming the same amount of power as if it were unrestricted. If it gets killed, then you're saving power but not getting notifications, which is bad. So it's just easier and safer to set it to unrestricted.