`LogisticRegression`: Conflicting warnings when following deprecation advice for `penalty=None` (sklearn 1.8.0)

### Describe the bug

I am encountering a catch-22 situation with `LogisticRegression` warnings in scikit-learn 1.8.0.

When I use `LogisticRegression(penalty=None)`, I get a `FutureWarning` advising me to use `C=np.inf` instead. However, when I follow this advice and use `LogisticRegression(C=np.inf)` (leaving `penalty` at its default), I get **both** the `FutureWarning` again and a `UserWarning` stating that `C` is ignored because `penalty=None`.

It seems that `C=np.inf` correctly disables regularization (effectively setting `penalty=None` internally), but this internal state then triggers the warning intended for users who explicitly pass conflicting arguments.


### Steps/Code to Reproduce

```python
import sys
import warnings
import numpy as np
import sklearn
from sklearn.linear_model import LogisticRegression
from sklearn.datasets import make_classification

X, y = make_classification(random_state=42)

print("LogisticRegression default params:", LogisticRegression().get_params())
print()

with warnings.catch_warnings(record=True) as w:
    warnings.simplefilter("always")

    print("--- Case 1: penalty=None ---")
    LogisticRegression(penalty=None).fit(X, y)
    for warning in w:
        print(f"{warning.category.__name__}: {warning.message}")

    print("\n--- Case 2: l1_ratio=0, C=np.inf ---")
    LogisticRegression(l1_ratio=0, C=np.inf).fit(X, y)
    for warning in w:
        print(f"{warning.category.__name__}: {warning.message}")
```

### Expected Results

Using `C=np.inf` (with default `penalty`) should be the correct way to specify no regularization without triggering warnings, as per the `FutureWarning` message. It should definitely not trigger a `UserWarning` claiming that `C` is ignored, since `C` was the parameter used to request this behavior.

### Actual Results


```text
LogisticRegression default params: {'C': 1.0, 'class_weight': None, 'dual': False, 'fit_intercept': True, 'intercept_scaling': 1, 'l1_ratio': 0.0, 'max_iter': 100, 'n_jobs': None, 'penalty': 'deprecated', 'random_state': None, 'solver': 'lbfgs', 'tol': 0.0001, 'verbose': 0, 'warm_start': False}

--- Case 1: penalty=None ---
FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', and C=np.inf instead of penalty=None.

--- Case 2: l1_ratio=0, C=np.inf ---
FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', and C=np.inf instead of penalty=None.
UserWarning: Setting penalty=None will ignore the C and l1_ratio parameters
```

### Versions

```shell
System:
    python: 3.13.3 (main, Apr  9 2025, 03:47:57) [Clang 20.1.0 ]
executable: /Users/rubens.filho/projects/pers/robust/.venv/bin/python
   machine: macOS-15.7.3-arm64-arm-64bit-Mach-O

Python dependencies:
      sklearn: 1.8.0
          pip: None
   setuptools: None
        numpy: 2.3.5
        scipy: 1.16.3
       Cython: None
       pandas: 2.3.3
   matplotlib: 3.10.8
       joblib: 1.5.2
threadpoolctl: 3.6.0

Built with OpenMP: True

threadpoolctl info:
       user_api: openmp
   internal_api: openmp
    num_threads: 10
         prefix: libomp
       filepath: /Users/rubens.filho/projects/pers/robust/.venv/lib/python3.13/site-packages/sklearn/.dylibs/libomp.dylib
        version: None
```

COMMENT:
Indeed this looks like an oversight, will open a PR based on @jackulau's [branch](https://github.com/scikit-learn/scikit-learn/compare/main...jackulau:scikit-learn:32927) that seems to go in the right direction. Thanks @jackulau for this by the way!

Labels: Bug