Making a script prefab

Can I make a script prefab? I mean in the inspector set all of its proporties and in game code instantiate and attach it to object?

I only could do it in a prefab containing an empty game object, but it seems like unnecessary overhead and even then I cannot attach it to any object I want.

You can use AddComponent to add a script to any object at run time. Or you can create, as you say, an empty object, add script(s), turn that into a prefab. With AddComponent you don't get the Inspector setting defaults on your vars, with the prefab you do.