Attribute error from `sklearn.base.is_regressor` due to missing `__sklearn_tags__` on nightly builds

### Describe the bug

Running the following script works without a warning in sklearn 1.7, but fails on the latest nightly release. It appears to be related to https://github.com/scikit-learn/scikit-learn/pull/31134, but I'm unsure why the issue only became apparent now.

### Steps/Code to Reproduce

```python
from sklearn.base import is_regressor

class MyEstimator:
    def __init__(self):
        ...

    def fit(self, X, y=None):
        self.is_fitted_ = True
        return self

    def predict(self, X):
        ...


est = MyEstimator()
is_regressor(est)
```

### Expected Results

I would expect the code to continue to run, possibly with a `DeprecationWarning`.

### Actual Results

```
Traceback (most recent call last):
  File "/Users/christian.bourjau/repos/scikit-learn-debug/.pixi/envs/nightlies/lib/python3.12/site-packages/sklearn/utils/_tags.py", line 275, in get_tags
    tags = estimator.__sklearn_tags__()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'MyEstimator' object has no attribute '__sklearn_tags__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/christian.bourjau/repos/scikit-learn-debug/t.py", line 17, in <module>
    is_regressor(est)
  File "/Users/christian.bourjau/repos/scikit-learn-debug/.pixi/envs/nightlies/lib/python3.12/site-packages/sklearn/base.py", line 1238, in is_regressor
    return get_tags(estimator).estimator_type == "regressor"
           ^^^^^^^^^^^^^^^^^^^
  File "/Users/christian.bourjau/repos/scikit-learn-debug/.pixi/envs/nightlies/lib/python3.12/site-packages/sklearn/utils/_tags.py", line 283, in get_tags
    raise AttributeError(
AttributeError: The following error was raised: 'MyEstimator' object has no attribute '__sklearn_tags__'. It seems that there are no classes that implement `__sklearn_tags__` in the MRO and/or all classes in the MRO call `super().__sklearn_tags__()`. Make sure to inherit from `BaseEstimator` which implements `__sklearn_tags__` (or alternatively define `__sklearn_tags__` but we don't recommend this approach). Note that `BaseEstimator` needs to be on the right side of other Mixins in the inheritance order.
```

### Versions

```shell
System:
    python: 3.12.11 | packaged by conda-forge | (main, Jun  4 2025, 14:38:53) [Clang 18.1.8 ]
executable: /Users/christian.bourjau/repos/scikit-learn-debug/.pixi/envs/nightlies/bin/python
   machine: macOS-15.6.1-arm64-arm-64bit

Python dependencies:
      sklearn: 1.8.dev0
          pip: 25.2
   setuptools: 80.9.0
        numpy: 2.2.6
        scipy: 1.16.0
       Cython: 3.1.2
       pandas: 3.0.0.dev0+2502.g8476e0f756
   matplotlib: None
       joblib: 1.5.1
threadpoolctl: 3.6.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: openblas
    num_threads: 16
         prefix: libopenblas
       filepath: /Users/christian.bourjau/repos/scikit-learn-debug/.pixi/envs/nightlies/lib/libopenblas.0.dylib
        version: 0.3.30
threading_layer: openmp
   architecture: VORTEX

       user_api: openmp
   internal_api: openmp
    num_threads: 16
         prefix: libomp
       filepath: /Users/christian.bourjau/repos/scikit-learn-debug/.pixi/envs/nightlies/lib/libomp.dylib
        version: None

       user_api: openmp
   internal_api: openmp
    num_threads: 16
         prefix: libomp
       filepath: /Users/christian.bourjau/repos/scikit-learn-debug/.pixi/envs/nightlies/lib/python3.12/site-packages/sklearn/.dylibs/libomp.dylib
        version: None
```

COMMENT:
I missed that indeed with `1.7` there is a `DeprecationWarning` in the original snippet [^1].

[^1]: `DeprecationWarning` are not seen by default if they come from the `__main__` module which is why I was not seeing it ... you can actually see the `DeprecationWarning` with `python -W::DeprecationWarning test-regressor.py`.

Taking a step back it seems like there are two ways to go about it and my feeling is that there is not a strong consensus on this for now:
1. a strong "historical" principle was to avoid being too frameworkish. Requiring a third-party estimator to derive from `BaseEstimator` can feel too frameworkish. In an ideal world, you would be able to write your own estimator from scratch without too much work. Also requiring people to depend on `scikit-learn` just for `BaseEstimator` (and maybe a few other base classes like `RegressorMixin`) seems a bit too much.
2. deriving from `BaseEstimator` makes life easier for third-party estimators for tags, metadata routing, and probably other things. It's getting more and more complicated to follow the principle from 1. and maybe we should give up on this ...

Labels: Bug