Python 3.8 (pre-release), \$L=80\$\$L=79\$, \$N\approx255^{1500}\$
-23 bytes thanks to @Jonathan Allan
f=lambda b,s=0,l=0:b and f(b[1:],255*s+b[0],l+(l!=1500)l+1)or s.to_bytes(l-(l>1500),"big")
Python source code can't contain null bytes. This converts the input (bytestring) to base 255 and then back to bytes. After 1500 removes a redundant byte.
Python 3.8 (pre-release), \$L=80\$, \$N\approx255^{1500}\$
-2 bytes thanks to @Jonathan Allan
f=lambda b,s=0,l=0:b and f(b[1:],255*s+b[0],l+(l!=1500))or s.to_bytes(l,"big")
Python source code can't contain null bytes. This converts the input (bytestring) to base 255 and then back to bytes. After 1500 removes a redundant byte.
Python 3.8 (pre-release), \$L=79\$, \$N\approx255^{1500}\$
-3 bytes thanks to @Jonathan Allan
f=lambda b,s=0,l=0:b and f(b[1:],255*s+b[0],l+1)or s.to_bytes(l-(l>1500),"big")
Python source code can't contain null bytes. This converts the input (bytestring) to base 255 and then back to bytes. After 1500 removes a redundant byte.
Python 3.8 (pre-release), \$L=80\$, \$N\approx255^{1500}\$
-2 bytes thanks to @Jonathan Allan
lambdaf=lambda b,s=0,l=0:0*[b and f(sb[1:=255*s+x],255*s+b[0],l+(l!=1500)for x in b]or)or s.to_bytes(len(b)-(len(b)>1500)l,"big")
Python source code can't contain null bytes. This converts the input (bytestring) to base 255 and then back to bytes. After 1500 removes a redundant byte.
Python 3.8 (pre-release), \$L=80\$, \$N\approx255^{1500}\$
lambda b,s=0:0*[(s:=255*s+x)for x in b]or s.to_bytes(len(b)-(len(b)>1500),"big")
Python source code can't contain null bytes. This converts the input (bytestring) to base 255 and then back to bytes. After 1500 removes a redundant byte.
Python 3.8 (pre-release), \$L=80\$, \$N\approx255^{1500}\$
-2 bytes thanks to @Jonathan Allan
f=lambda b,s=0,l=0:b and f(b[1:],255*s+b[0],l+(l!=1500))or s.to_bytes(l,"big")
Python source code can't contain null bytes. This converts the input (bytestring) to base 255 and then back to bytes. After 1500 removes a redundant byte.
Python 3.8 (pre-release), \$L=82\$\$L=80\$, \$N\approx255^{1500}\$
f=lambdalambda b,s=0:0*[(s:=255*s+x)for x in b]or s.to_bytes(len(b)-(len(b)>1500),"big")
Python source code can't contain null bytes. This converts the input (bytestring) to base 255 and then back to bytes. After 1500 removes a redundant byte.
Python 3.8 (pre-release), \$L=82\$, \$N\approx255^{1500}\$
f=lambda b,s=0:0*[(s:=255*s+x)for x in b]or s.to_bytes(len(b)-(len(b)>1500),"big")
Python source code can't contain null bytes. This converts the input (bytestring) to base 255 and then back to bytes.
Python 3.8 (pre-release), \$L=80\$, \$N\approx255^{1500}\$
lambda b,s=0:0*[(s:=255*s+x)for x in b]or s.to_bytes(len(b)-(len(b)>1500),"big")
Python source code can't contain null bytes. This converts the input (bytestring) to base 255 and then back to bytes. After 1500 removes a redundant byte.