If you are using a heat gun, you can heat it up quite a bit, but, the rule I was taught was...If it's too hot to touch, it's too hot.
Heat the molding till it's fairly hot, then let it sit for a minute or two, to let the heat soak into the molding and soften that glue up. Being black, the molding will retain a lot of the heat. Just heating up the outer surface will not soften the glue.
It takes a lot of heat to burn paint. Think how hot that it gets just sitting in the sun on a sunny day. The glue on the molding will soften up before the paint burns.
Keep the heat gun moving. Circular motions, working the length of it. As you move down the length, keep going back some, in order to keep the part that you just heated warm.
Watch what you're doing as you do this. Don't get distracted, because if you look away, the heat gun will stop moving. Held in one spot for too long WILL cause things to get burnt.
I've seen people (employees!) burn brand new conv. tops & headliners with just a moment of inattention.