CLN: remove total_seconds compat from json
- [x] closes #17340
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`

cc @jbrockmendel

`total_seconds` is only used once.  If it can be replaced with a one-liner, go ahead and get rid of the function entirely. It can't be a one-liner because we have to decref the object `PyObject_CallMethod` returns.  Even though it's only used once, I think the code reads better as a separate function because it splits out the python bookkeeping from the json logic. lgtm. can you push again to force CI's to run again (just to make sure passing on windows).
 # [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17341?src=pr&el=h1) Report
> :exclamation: No coverage uploaded for pull request base (`master@36dadd7`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff            @@
##             master   #17341   +/-   ##
=========================================
  Coverage          ?   91.02%           
=========================================
  Files             ?      162           
  Lines             ?    49567           
  Branches          ?        0           
=========================================
  Hits              ?    45116           
  Misses            ?     4451           
  Partials          ?        0
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.8% <ø> (?)` | |
| #single | `40.25% <ø> (?)` | |


------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17341?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/17341?src=pr&el=footer). Last update [36dadd7...ab58138](https://codecov.io/gh/pandas-dev/pandas/pull/17341?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
 # [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17341?src=pr&el=h1) Report
> :exclamation: No coverage uploaded for pull request base (`master@36dadd7`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff            @@
##             master   #17341   +/-   ##
=========================================
  Coverage          ?   90.99%           
=========================================
  Files             ?      162           
  Lines             ?    49567           
  Branches          ?        0           
=========================================
  Hits              ?    45104           
  Misses            ?     4463           
  Partials          ?        0
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.77% <ø> (?)` | |
| #single | `40.24% <ø> (?)` | |


------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17341?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/17341?src=pr&el=footer). Last update [36dadd7...ab58138](https://codecov.io/gh/pandas-dev/pandas/pull/17341?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
