How to add a curve name from bevel_object to the name of the output image render? Excuse me, I misunderstood the question.
Usually, when rendering, the image can be saved with F3 or through the node's "File Output", with a name of the form "ImageXXX", according to the frame number. I want to have anything instead of ImageXXX - the name of the selected object, material, and so on. In this particular case, I want the name of the "Bevel Object" selecter curve,  to be recorded in the name of the output image.
If I got what you mean, you need to edit this property, 

https://docs.blender.org/api/blender_python_api_current/bpy.types.NodeOutputFileSlotFile.html

this string will be the prefix for output to image from that node, as you see below:



Of course you need to know the name of the object, as you say, but I guess this is quite easy...