Python, 9887 bytes, score 9 (ASCII only code)
See Unrelated String's solution for a lower score by using non-ascii characters
-4 bytes, thanks to noodle man
-9 bytes, thanks to l4m2
def f(s):print(f"exec({'+'.join('chr('+'+'.join(['1']*ord'+'+1'*ord(c))+')'for c in f'print({repr(s)})')})")
encodes string using exc()hr1+
Explanation
Encodes string as exec(chr(1+...+1)+chr(1+1+...)+...)
The executed code is print(S)
with S
being the string-representation of the input. The characters in the string are represented as sums of 1
's
Python, 85 bytes, score 11
def f(s):print(f"exec({'+'.join(f'chr(0b{ord(c):b})'for c in f'print({repr(s)})')})")
encodes string using exc()hr0b1+