Yes, to a large extent.
I think that developers in statically typed languages have an unhealthy fear of any dynamics. Almost every line of code in a dynamically typed language is actually a string literal, and they have been doing fine for years. For example, in JavaScript, technically this is:
var x = myObject.prop1.prop2;
This is equivalent to this:
var x = window["myObject"]["prop1"]["prop2"]; // assuming global scope
But for JavaScript, this is definitely not a standard practice:
var OBJ_NAME = "myObject"; var PROP1_NAME = "prop1"; var PROP2_NAME = "prop2"; var x = window[OBJ_NAME][PROP1_NAME][PROP2_NAME];
That would be just ridiculous.
It all the same depends on how, for example, if a string is used in many places, and it is rather bulky / ugly to print ("name" or "my-custom-property-name-x"), then it’s probably worth it make a constant, even within the same class (at which point it is probably good to be internally consistent inside the class and do all the other string constants too).
In addition, if you really want other external users to interact with your library using these constants, then it would also be nice to define public constants and a document so that users can use them to interact with your library. However, a library that interacts through magic string constants is usually bad practice, and you should consider creating your own library in such a way that you do not need to use magic constants to interact with it in the first place.
I think in the specific example that you indicated where the strings are relatively easy to enter and there are apparently no external users of your API who would expect to work with it using these string values (i.e. they are only for internal data manipulation), readable code is much more valuable than refactored code, so I would just put literals directly in line. Again, this assumes that I understand your specific use case for sure.
One thing that no one seemed to notice is that once you define a constant, its volume becomes something that needs to be maintained and thought. It really has value, it is not free, as it seems to everyone. Consider this:
Should it be private or public in my class? What if one other namespace / package needs one value, should I now extract the constant into some global static constant class? What if I need it in other assemblies / modules, will I extract it further? All this makes the code less comprehensible, harder to maintain, less enjoyable to work with, and harder. All in the name of refactorability?
Usually these "excellent refactorings" never occur, and when they do, they require a complete rewrite anyway with all the new lines. And if you used some general module before this big refactoring (as in the previous paragraph), which did not have these new lines that you now need, what then? You add them to the same general module of constants (what if you do not have access to the code for this general module)? Or do you keep them local to yourself, and in this case there are now several scattered repositories of string constants, all at different levels, at risk of duplicating constants throughout the code? Once you get to this point (and believe me I saw it), refactoring becomes controversial, because until you get all your habits of your constants, you will miss other people using their constants, although these constants have something same logical meaning as your constants, and you are actually trying to change them all.