MATL, 16 bytes
t~40+v3L)7MQ3L)h
###Explanation
Explanation
t % Implicit input. Duplicate
% STACK: 'foobar', 'foobar'
~ % Negate. Transforms into an array of zeros
% STACK: 'foobar', [0 0 0 0 0 0]
40+ % Add 40, element-wise. Gives array containing 40 repeated
% STACK: 'foobar', [40 40 40 40 40 40]
v % Concatenate vertically. Gives a two-row char array, with 40 cast into '('
% STACK: ['foobar'; '((((((']
3L) % Remove last element. Converts to row vector
% STACK: 'f(o(o(b(a(r'
7M % Push array containing 40 again
% STACK: 'f(o(o(b(a(r', [40 40 40 40 40 40]
Q % Add 1, element-wise
% STACK: 'f(o(o(b(a(r', [41 41 41 41 41 41]
h % Concatenate horizontally, with 41 cast into ')'
% STACK: 'f(o(o(b(a(r)))))'
% Implicit display