Layer from string

It is required to add layers in ‘Layers And Tags Settings’ by string ID, and select actor layer in editor.

But in script, Layer attribute of Actor is assigned by integer and only can be compared indirectly with string ID by HasLayer(String) in LayersMask.

Is there a way to query Layer value (integer) from the string in C#, and assign to Layer field?

Also, is there a little easier way to configure LayersMask rather than (1<<layerID1)|(1<<layerID2)|(1<<layerID3)… , with string IDs?