LGB,
The simple answer is YES, but a definition of when a close-in obstacle becomes a far-out constraint is required.
Consider a constant climb at Flaps 10°. Gradient is less than optimum, but for a near obstacle we dare not reduce the gradient to accelerate to the higher speed and clean up until passing the obstacle. Now consider a 'composite' climb, initially at Flaps 10°, then a much reduced climb gradient whilst we accelerate to clean speed, and a final improved climb gradient in the clean configuration. At one point, the two vertical paths will cross each other. Prior to their intersection, Flaps 10° is the answer, beyond the point, the clean configuration will provide the optimum climb gradient locus. Therein lies the definition of "near-in" and "far-out".
Regards,
Old Smokey