Repository: yt-dlp
Issue: Split string across the lines in config files
Labels: enhancement

### DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

- [X] I understand that I will be **blocked** if I *intentionally* remove or skip any mandatory\* field

### Checklist

- [X] I'm requesting a feature unrelated to a specific site
- [X] I've looked through the [README](https://github.com/yt-dlp/yt-dlp#readme)
- [X] I've verified that I have **updated yt-dlp to nightly or master** ([update instructions](https://github.com/yt-dlp/yt-dlp#update-channels))
- [X] I've searched [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues **including closed ones**. DO NOT post duplicates
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)

### Provide a description that is worded well enough to be understood

### The problem

With so many formatting options, I can get really long and elaborate output templates in config files, which is good. When this happens, it would be nice to be able to concatenate 2 shorter output templates across 2 lines, instead of writing everything as a 200-char long single line.

### Expected behavior

For example, in bash scripts, which `yt.conf` mostly resembles, instead of
`--output 'dirpath/filepath'`
I could write:
```bash
--output 'dirpath/'\
'filepath'
```
or (with caveats)
```bash
--output "dirpath/\
filepath"
```
in Python it would be:
```python
output = 'dirpath/' + \
'filepath'
```
Of course, `\` is only necessary, because newlines are meaningful in these syntaxes. In a language where newline is not meaningful, it could be as simple as
```bash
--output 'dirpath/'
'filepath'
```

### Actual behavior

In `yt.conf` none of these do the job:

**1** There's no dedicated string concatenation operator, yet
`--output 'dirpath/' 'filepath'`
won't work either.
**2** Even though (1) won't work, this will:
```bash
--output 'dirpath/'\
'filepath'
```
but it will produce `dirpath/↵filepath`, which is both inconsistent with (1), and doesn't really make sense, since neither string literal contains a newline, but output does.
**3** And no backslash in (2) is an error, since it will treat second line as a separate argument (the URL).
**4** Writing literals also work across the lines, but there's no way to escape newline inside the string, it will just treat `\` as a literal `\`
For example, this
```bash
--output 'dirpath/\
filepath'
```
will give you this: `dirpath/\↵filenapth`.

### Takeaways

I think this is closely related to #6924, since the common culprit, unfortunately, seems to be just overall inconsistent newline treatment in string literals. It is both impossible to specify that you want a newline on a single line, and that you don't want a newline across the multiple lines.

Hence, I think the best would be to change the existing semantics: `\` should escape newlines, and hence (2) should be semantically identical to (1). So either:
- (a) both mean string concatenation w/o newline in between, or…
- (b) both mean the same as (3), and a dedicated string concatenation operator is implemented (for example, `+`)

Both are not perfect, since (a) breaks more existing behavior (even though my opinion would be that it doesn't make much sense to hardcode URLs on the same string as options in sonfig files), but keeps it closer to shell syntax, and (b) doesn't break much, but makes shell string semantics different from `yt.conf` semantics.

### Proposed solution

Overall, I propose (b), so the answer to my initial problem would be:
```bash
--output 'dirpath/' + \
'filepath'
```

It would be especially great, if the parser just strips comments before parsing, so this would work the same:
```bash
--output 'dirpath/' + \ # comment 1
# comment 2
'filepath'
```

### Provide verbose output that clearly demonstrates the problem

- [ ] Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
- [ ] If using API, add `'verbose': True` to `YoutubeDL` params instead
- [ ] Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below

### Complete Verbose Output

_No response_