This is the mirror image of #2170.

### Checklists

<!-- Note on checklists:
     If you think some of these steps are not necessary for your PR,
     just remove those checkboxes, or mark them as checked. Otherwise,
     if some checkboxes are left unmarked, we might assume that your PR
     is not ready to be merged and we might keep you waiting -->

- [x] Add a [CHANGELOG](https://github.com/pyodide/pyodide/blob/main/docs/project/changelog.md) entry
- [x] Add / update tests
- [x] Add new / update outdated documentation

Add `default_converter` argument to `to_js` and `toJs`. This is the mirror image of #2170.

### Checklists

<!-- Note on checklists:
     If you think some of these steps are not necessary for your PR,
     just remove those checkboxes, or mark them as checked. Otherwise,
     if some checkboxes are left unmarked, we might assume that your PR
     is not ready to be merged and we might keep you waiting -->

- [x] Add a [CHANGELOG](https://github.com/pyodide/pyodide/blob/main/docs/project/changelog.md) entry
- [x] Add / update tests
- [x] Add new / update outdated documentation

package:
  name: numpy
  version: 1.21.4

source:
  url: https://files.pythonhosted.org/packages/fb/48/b0708ebd7718a8933f0d3937513ef8ef2f4f04529f1f66ca86d873043921/numpy-1.21.4.zip
  sha256: e6c76a87633aa3fa16614b61ccedfae45b91df2767cf097aa9c933932a7ed1e0

  patches:
    - patches/disable-maybe-uninitialized.patch
    - patches/dont-include-execinfo.patch
    - patches/fix-longdouble.patch
    - patches/fix-static-init-of-nditer-pywrap.patch
    - patches/init-alloc-cache.patch
    - patches/use-local-blas-lapack.patch
    - patches/fix-install-with-skip-build.patch
    - patches/make-int-return-values.patch
    - patches/fix-ieee754.patch
    - patches/disable-optimization.patch
    - patches/not-build-lapack-lite-as-64-bit.patch
    - patches/fix-invalid-asm-instruction.patch
    - patches/fix-removed-decorators-module.patch
    - patches/fix-comparator-function-signatures.patch
    - patches/fix-random_float_fill-return-type.patch

build:
  skip_host: False
  # set linker and C flags to error on anything to do with function declarations being wrong.
  # In webassembly, any conflicts mean that a randomly selected 50% of calls to the function
  # will fail. Better to fail at compile or link time.
  cflags: |
    -include math.h
    -I $(PYODIDE_ROOT)/packages/numpy/config
    -Werror=implicit-function-declaration
    -Werror=mismatched-parameter-types
    -Werror=mismatched-return-types
  ldflags: |
    -Wl,--fatal-warnings
  post: |
    # copy the correct numpy config into the build artifacts. Otherwise scipy will try to build with the config
    # from the build computer and bad things will happen
    cp config/* $PKGDIR/../.artifacts/lib/python/numpy-1.21.4-py3.9-emscripten_wasm32.egg/numpy/core/include/numpy
    cp -r $PKGDIR/../.artifacts/lib/python/numpy-1.21.4-py3.9-emscripten_wasm32.egg/numpy $PKGDIR/../.artifacts/lib/python

test:
  imports:
    - numpy

package:
  name: numpy
  version: 1.21.4

source:
  url: https://files.pythonhosted.org/packages/fb/48/b0708ebd7718a8933f0d3937513ef8ef2f4f04529f1f66ca86d873043921/numpy-1.21.4.zip
  sha256: e6c76a87633aa3fa16614b61ccedfae45b91df2767cf097aa9c933932a7ed1e0

  patches:
    - patches/disable-maybe-uninitialized.patch
    - patches/dont-include-execinfo.patch
    - patches/fix-longdouble.patch
    - patches/fix-static-init-of-nditer-pywrap.patch
    - patches/init-alloc-cache.patch
    - patches/use-local-blas-lapack.patch
    - patches/fix-install-with-skip-build.patch
    - patches/make-int-return-values.patch
    - patches/fix-ieee754.patch
    - patches/disable-optimization.patch
    - patches/not-build-lapack-lite-as-64-bit.patch
    - patches/fix-invalid-asm-instruction.patch
    - patches/fix-removed-decorators-module.patch
    - patches/fix-comparator-function-signatures.patch
    - patches/fix-random_float_fill-return-type.patch

build:
  skip_host: False
  # set linker and C flags to error on anything to do with function declarations being wrong.
  # In webassembly, any conflicts mean that a randomly selected 50% of calls to the function
  # will fail. Better to fail at compile or link time.
  cflags: |
    -include math.h
    -I $(PYODIDE_ROOT)/packages/numpy/config
    -Werror=implicit-function-declaration
    -Werror=mismatched-parameter-types
    -Werror=mismatched-return-types
  ldflags: |
    -Wl,--fatal-warnings
  post: |
    # copy the correct numpy config into the build artifacts. Otherwise scipy will try to build with the config
    # from the build computer and bad things will happen
    cp config/* $PKGDIR/../.artifacts/lib/python/numpy-1.21.4-py3.9-emscripten_wasm32.egg/numpy/core/include/numpy
    cp -r $PKGDIR/../.artifacts/lib/python/numpy-1.21.4-py3.9-emscripten_wasm32.egg/numpy $PKGDIR/../.artifacts/lib/python

test:
  imports:
    - numpy
