Cannot increase verbosity of SGDRegressor fit

### Describe the bug

Increasing verbosity of SGDRegressor triggers an error from cython.


### Steps/Code to Reproduce

```
import numpy as np
import pandas as pd
from sklearn.linear_model import SGDRegressor

n_samples = 100
y = pd.DataFrame({"y": np.random.randint(low=0, high=100, size=n_samples)})
X = pd.DataFrame({"num_1": np.random.randint(low=0, high=100, size=n_samples)})

model_params = {"verbose": 1}

model = SGDRegressor(**model_params)
model_fitted = model.fit(X, y.values.ravel())
```

### Expected Results

Logs from the fitting are available for debugging.

### Actual Results


```
>>> python minimal_example.py
-- Epoch 1
Traceback (most recent call last):
  File "/Users/ludwik/workspace/experiments/minimal_example.py", line 12, in <module>
    model_fitted = model.fit(X, y.values.ravel())
  File "/Users/ludwik/.pyenv/versions/3.9.15/envs/harvesting_yield/lib/python3.9/site-packages/sklearn/linear_model/_stochastic_gradient.py", line 1588, in fit
    return self._fit(
  File "/Users/ludwik/.pyenv/versions/3.9.15/envs/harvesting_yield/lib/python3.9/site-packages/sklearn/linear_model/_stochastic_gradient.py", line 1533, in _fit
    self._partial_fit(
  File "/Users/ludwik/.pyenv/versions/3.9.15/envs/harvesting_yield/lib/python3.9/site-packages/sklearn/linear_model/_stochastic_gradient.py", line 1461, in _partial_fit
    self._fit_regressor(
  File "/Users/ludwik/.pyenv/versions/3.9.15/envs/harvesting_yield/lib/python3.9/site-packages/sklearn/linear_model/_stochastic_gradient.py", line 1671, in _fit_regressor
    coef, intercept, average_coef, average_intercept, self.n_iter_ = _plain_sgd(
  File "sklearn/linear_model/_sgd_fast.pyx", line 629, in sklearn.linear_model._sgd_fast._plain_sgd
AttributeError: 'sklearn.linear_model._sgd_fast._memoryviewslice' object has no attribute 'nonzero'
```

### Versions

```shell
System:
    python: 3.9.15 (main, Nov  9 2022, 18:08:21)  [Clang 13.1.6 (clang-1316.0.21.2.5)]
executable: /Users/ludwik/.pyenv/versions/3.9.15/envs/harvesting_yield/bin/python
   machine: macOS-13.1-arm64-arm-64bit

Python dependencies:
      sklearn: 1.2.0
          pip: 22.0.4
   setuptools: 65.6.3
        numpy: 1.23.5
        scipy: 1.9.3
       Cython: 0.29.32
       pandas: 1.5.2
   matplotlib: 3.6.2
       joblib: 1.2.0
threadpoolctl: 3.1.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: openblas
         prefix: libopenblas
       filepath: /Users/ludwik/.pyenv/versions/3.9.15/envs/harvesting_yield/lib/python3.9/site-packages/numpy/.dylibs/libopenblas64_.0.dylib
        version: 0.3.20
threading_layer: pthreads
   architecture: armv8
    num_threads: 10

       user_api: openmp
   internal_api: openmp
         prefix: libomp
       filepath: /Users/ludwik/.pyenv/versions/3.9.15/envs/harvesting_yield/lib/python3.9/site-packages/sklearn/.dylibs/libomp.dylib
        version: None
    num_threads: 10

       user_api: blas
   internal_api: openblas
         prefix: libopenblas
       filepath: /Users/ludwik/.pyenv/versions/3.9.15/envs/harvesting_yield/lib/python3.9/site-packages/scipy/.dylibs/libopenblasp-r0.3.20.dylib
        version: 0.3.18
threading_layer: pthreads
   architecture: armv8
    num_threads: 10
```

COMMENT:
Thanks for the report @GOGKI, this is a regression from #24883.

Labels: Bug, Regression