fix and test incorrect case in delta_to_nanoseconds
Some minor cython cleanup along the way
Hello @jbrockmendel! Thanks for submitting the PR.

 - There are no PEP8 issues in the file [`pandas/tests/tslibs/test_timedeltas.py`](https://github.com/jbrockmendel/pandas/blob/e3caa49bc35315f1e35c69d1b63122e34892dc72/pandas/tests/tslibs/test_timedeltas.py) !

 # [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/23302?src=pr&el=h1) Report
> Merging [#23302](https://codecov.io/gh/pandas-dev/pandas/pull/23302?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/5a0c91e5a5bc61c71da08d6968d973255829678d?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/23302/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/23302?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master   #23302   +/-   ##
=======================================
  Coverage   92.22%   92.22%           
=======================================
  Files         169      169           
  Lines       50897    50897           
=======================================
  Hits        46940    46940           
  Misses       3957     3957
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.65% <ø> (ø)` | :arrow_up: |
| #single | `42.29% <ø> (ø)` | :arrow_up: |


------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/23302?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/23302?src=pr&el=footer). Last update [5a0c91e...e3caa49](https://codecov.io/gh/pandas-dev/pandas/pull/23302?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
 does this have any perf issue? > does this have any perf issue?

Haven't checked, but should even out, to very slight improvement.  Replace one never-true (early, c-speed) type check with a (late, c-speed) type check.
 thanks!