is it possible to somehow execute this, so that I get the status of the show_name option?
import bpy
a = "show_name"
b = "bpy.data.scenes['Scene'].objects['Cube']" + "." + a
You can use
eval(b)
eval() will take any valid Python expression string as argument.
To set a value, use
exec(c)
But be careful, exec() will execute ANY python code, so it is considered a very dangerous command, especially if the string is from user input.
I would advice rethinking how your code is setup, there is usually very little reason to access bpy in these fashion.